diff options
| author | GodOfAvacyn <59858208+GodOfAvacyn@users.noreply.github.com> | 2024-02-29 02:30:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-29 11:30:33 +0100 |
| commit | 06b5fda797ea4c363e9fe17b160c33818be8d319 (patch) | |
| tree | d365a0a931ac102e60fb41b14e14cdd0b2547026 /queries/gdshader | |
| parent | Update parsers: chatito, gitattributes, gitcommit, gpg, groovy, hlsl, mermaid... (diff) | |
| download | nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar.gz nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar.bz2 nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar.lz nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar.xz nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.tar.zst nvim-treesitter-06b5fda797ea4c363e9fe17b160c33818be8d319.zip | |
feat: add support for gdshader (#6153)
Godot shading language
---------
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Diffstat (limited to 'queries/gdshader')
| -rw-r--r-- | queries/gdshader/highlights.scm | 142 | ||||
| -rw-r--r-- | queries/gdshader/injections.scm | 2 |
2 files changed, 144 insertions, 0 deletions
diff --git a/queries/gdshader/highlights.scm b/queries/gdshader/highlights.scm new file mode 100644 index 000000000..797681a0c --- /dev/null +++ b/queries/gdshader/highlights.scm @@ -0,0 +1,142 @@ +[ + "render_mode" + "shader_type" + "group_uniforms" + "global" + "instance" + "const" + "varying" + "uniform" + "struct" +] @keyword + +[ + (precision_qualifier) + (interpolation_qualifier) +] @type.qualifier + +[ + "in" + "out" + "inout" +] @keyword.storage + +[ + "while" + "for" +] @keyword.repeat + +[ + "continue" + "break" + "return" +] @keyword.return + +[ + "if" + "else" + "switch" + "case" + "default" +] @keyword.conditional + +[ + "#" + "include" +] @keyword.directive + +(string) @string + +[ + "=" + "+=" + "-=" + "!" + "~" + "+" + "-" + "*" + "/" + "%" + "||" + "&&" + "|" + "^" + "&" + "==" + "!=" + ">" + ">=" + "<=" + "<" + "<<" + ">>" + "++" + "--" +] @operator + +(boolean) @boolean + +(integer) @number + +(float) @number.float + +[ + "." + "," + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(builtin_type) @type.builtin + +(ident_type) @type.definition + +[ + (shader_type) + (render_mode) + (hint_name) +] @attribute + +(builtin_variable) @constant.builtin + +(builtin_function) @function.builtin + +(group_uniforms_declaration + group_name: (ident) @property + subgroup_name: (ident) @property) + +(struct_declaration + name: (ident) @type) + +(struct_member + name: (ident) @property) + +(function_declaration + name: (ident) @function) + +(parameter + name: (ident) @variable.parameter) + +(member_expr + member: (ident) @property) + +(call_expr + function: + [ + (ident) + (builtin_type) + ] @function) + +(call_expr + function: (builtin_type) @function.call) + +(comment) @comment @spell diff --git a/queries/gdshader/injections.scm b/queries/gdshader/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/queries/gdshader/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
