parsers: add wgsl_bevy

This adds an extension of tree-sitter-wgsl that understands
[Bevy's](https://bevyengine.org/) preprocessor directives.
This commit is contained in:
Stephan Seitz 2022-12-25 17:40:05 +01:00
parent 29304e16bb
commit 817531ce6f
4 changed files with 46 additions and 0 deletions

View file

@ -1183,6 +1183,15 @@ list.wgsl = {
filetype = "wgsl",
}
list.wgsl_bevy = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-wgsl-bevy",
files = { "src/parser.c" },
generate_requires_npm = true,
},
maintainers = { "@theHamsta" },
}
list.m68k = {
install_info = {
url = "https://github.com/grahambates/tree-sitter-m68k",

View file

@ -0,0 +1,5 @@
; inherits wgsl
[
(preproc_ifdef)
] @fold

View file

@ -0,0 +1,25 @@
; inherits wgsl
[
"#import"
"#define_import_path"
] @include
"::" @punctuation.delimiter
(import_path (identifier) @namespace (identifier))
(struct_declaration
(preproc_ifdef (struct_member (variable_identifier_declaration (identifier) @field))))
(struct_declaration
(preproc_ifdef
(preproc_else (struct_member (variable_identifier_declaration (identifier) @field)))))
(preproc_ifdef
name: (identifier) @constant.macro)
[
"#ifdef"
"#ifndef"
"#endif"
"#else"
] @preproc

View file

@ -0,0 +1,7 @@
; inherits wgsl
[
"#ifdef"
"#ifndef"
"#else"
"#endif"
] @zero_indent