#hlsl #parser #incremental

tree-sitter-hlsl

HLSL grammar for the tree-sitter parsing library

5 releases

0.1.4 Apr 2, 2024
0.1.3 Apr 1, 2024
0.1.2 Aug 20, 2022
0.1.1 Aug 11, 2022
0.1.0 Aug 11, 2022

#265 in Text editors

Download history 3/week @ 2024-02-20 18/week @ 2024-02-27 1/week @ 2024-03-05 1/week @ 2024-03-12 71/week @ 2024-03-26 273/week @ 2024-04-02 21/week @ 2024-04-09 3/week @ 2024-04-16 4/week @ 2024-04-23

372 downloads per month

MIT license

27MB
769K SLoC

C 769K SLoC // 0.0% comments JavaScript 88 SLoC Rust 34 SLoC // 0.1% comments

tree-sitter-hlsl

This is a extension of tree-sitter-cpp to support the syntax of HLSL (https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl).

Work in progress...


lib.rs:

This crate provides hlsl language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_hlsl::language()).expect("Error loading hlsl grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~71K SLoC