#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

#139 in Text editors

Download history 1/week @ 2024-02-19 19/week @ 2024-02-26 2/week @ 2024-03-04 1/week @ 2024-03-11 343/week @ 2024-04-01

344 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.6–4MB
~71K SLoC