parsers: add tree-sitter-slang

This commit is contained in:
Stephan Seitz 2023-11-18 20:52:31 +01:00
parent b04f990f92
commit 10432e6b0f
8 changed files with 78 additions and 0 deletions

9
queries/slang/folds.scm Normal file
View file

@ -0,0 +1,9 @@
; inherits: hlsl
[
(interface_specifier)
(extension_specifier)
(property_declaration)
(subscript_declaration)
(init_declaration)
] @fold

View file

@ -0,0 +1,42 @@
; inherits: hlsl
[
"var"
"let"
"This"
] @type.builtin
[
"interface"
"extension"
"property"
] @keyword
[
"__init"
] @constructor
[
"__subscript"
"get"
"set"
] @function.builtin
(interface_requirements (identifier) @type)
(binary_expression
["is" "as"]
right: (identifier) @type)
[
"as"
"is"
] @keyword.operator
[
"__exported"
"import"
] @include
(property_declaration
(identifier) @property)

View file

@ -0,0 +1,6 @@
; inherits: hlsl
[
(interface_specifier)
(extension_specifier)
] @indent.begin

View file

@ -0,0 +1,5 @@
((preproc_arg) @injection.content
(#set! injection.language "slang"))
((comment) @injection.content
(#set! injection.language "comment"))

1
queries/slang/locals.scm Normal file
View file

@ -0,0 +1 @@
; inherits: hlsl