diff options
author | Kirawi | 2021-11-27 02:19:40 +0000 |
---|---|---|
committer | GitHub | 2021-11-27 02:19:40 +0000 |
commit | 4ec20eaeffa6144f01ae8d5a95b12ea1593f3080 (patch) | |
tree | 8fc2aea5d8e543e31d1d0c40552a4fa3d1c2a9c8 /runtime/queries | |
parent | 6e62c3de47ff14df394c1c17fec103c134aa045c (diff) |
Add language support for WGSL (#1166)
Diffstat (limited to 'runtime/queries')
-rw-r--r-- | runtime/queries/wgsl/highlights.scm | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/runtime/queries/wgsl/highlights.scm b/runtime/queries/wgsl/highlights.scm new file mode 100644 index 00000000..7fbc87d8 --- /dev/null +++ b/runtime/queries/wgsl/highlights.scm @@ -0,0 +1,102 @@ +(const_literal) @constant.numeric + +(type_declaration) @type + +(function_declaration + (identifier) @function) + +(struct_declaration + (identifier) @type) + +(type_constructor_or_function_call_expression + (type_declaration) @function) + +(parameter + (variable_identifier_declaration (identifier) @variable.parameter)) + +[ + "struct" + "bitcast" + ; "block" + "discard" + "enable" + "fallthrough" + "fn" + "let" + "private" + "read" + "read_write" + "return" + "storage" + "type" + "uniform" + "var" + "workgroup" + "write" + (texel_format) +] @keyword ; TODO reserved keywords + +[ + (true) + (false) +] @constant.builtin.boolean + +[ "," "." ":" ";" ] @punctuation.delimiter + +;; brackets +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "loop" + "for" + "break" + "continue" + "continuing" +] @keyword.control.repeat + +[ + "if" + "else" + "elseif" + "switch" + "case" + "default" +] @keyword.control.conditional + +[ + "&" + "&&" + "/" + "!" + "=" + "==" + "!=" + ">" + ">=" + ">>" + "<" + "<=" + "<<" + "%" + "-" + "+" + "|" + "||" + "*" + "~" + "^" +] @operator + +(attribute + (identifier) @variable.other.member) + +(comment) @comment + +(ERROR) @error |