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

View file

@ -360,6 +360,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) (maintained by @WhyNotHugo)
- [ ] [scheme](https://github.com/6cdh/tree-sitter-scheme)
- [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva)
- [x] [slang](https://github.com/theHamsta/tree-sitter-slang) (experimental, maintained by @theHamsta)
- [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton)
- [x] [smali](https://git.sr.ht/~yotam/tree-sitter-smali) (maintained by @amaanq)
- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol)

View file

@ -560,6 +560,9 @@
"scss": {
"revision": "c478c6868648eff49eb04a4df90d703dc45b312a"
},
"slang": {
"revision": "47415d3f9ed2b3df9b9fc5f5d0ee1a71be3c67e0"
},
"slint": {
"revision": "00c8a2d3645766f68c0d0460086c0a994e5b0d85"
},

View file

@ -1649,6 +1649,17 @@ list.scss = {
maintainers = { "@elianiva" },
}
list.slang = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-slang",
files = { "src/parser.c", "src/scanner.c" },
generate_requires_npm = true,
},
filetype = "shaderslang",
maintainers = { "@theHamsta" },
experimental = true,
}
list.slint = {
install_info = {
url = "https://github.com/jrmoulton/tree-sitter-slint",

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