diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-02-01 22:35:54 -0500 |
|---|---|---|
| committer | ObserverOfTime <chronobserver@disroot.org> | 2023-02-02 23:28:46 +0200 |
| commit | 660a070af7131387c690c7b839718371916e27f9 (patch) | |
| tree | 3a25d79bd23bb98498bbef385e6ac6f18c9bd4de /queries/func/highlights.scm | |
| parent | `jq/highlights.scm` should highlight the `elif` keyword (diff) | |
| download | nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar.gz nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar.bz2 nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar.lz nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar.xz nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.tar.zst nvim-treesitter-660a070af7131387c690c7b839718371916e27f9.zip | |
feat: add func
Diffstat (limited to 'queries/func/highlights.scm')
| -rw-r--r-- | queries/func/highlights.scm | 194 |
1 files changed, 194 insertions, 0 deletions
diff --git a/queries/func/highlights.scm b/queries/func/highlights.scm new file mode 100644 index 000000000..bda9e2ec1 --- /dev/null +++ b/queries/func/highlights.scm @@ -0,0 +1,194 @@ +; Include + +"#include" @include +(include_path) @string + +; Preproc + +[ + "#pragma" +] @preproc + +(pragma_directive + [ + "version" + "not-version" + "test-version-set" + ] @preproc) + +; Functions/Methods + +(function_definition + name: (function_name) @function) + +(function_application + function: (identifier) @function) + +(method_call + method_name: (identifier) @method.call) + +; Parameters + +(parameter) @parameter + +(function_application + arguments: [(identifier) (underscore)] @parameter) +(function_application + arguments: (tensor_expression + (identifier) @parameter)) +(function_application + arguments: (parenthesized_expression + (identifier) @parameter)) + +(method_call + arguments: [(identifier) (underscore)] @parameter) +(method_call + arguments: (tensor_expression + (identifier) @parameter)) +(method_call + arguments: (parenthesized_expression + (identifier) @parameter)) + +; Constants + +(const_var_declarations + name: (identifier) @constant) +(unit_literal) @constant.builtin + +; Variables + +(identifier) @variable + +; Types + +(type_identifier) @type +(primitive_type) @type.builtin +(unit_type) @type.builtin + +; Operators + +[ + "=" + "+=" + "-=" + "*=" + "/=" + "~/=" + "^/=" + "%=" + "~%=" + "^%=" + "<<=" + ">>=" + "~>>=" + "^>>=" + "&=" + "|=" + "^=" + "==" + "<" + ">" + "<=" + ">=" + "!=" + "<=>" + "<<" + ">>" + "~>>" + "^>>" + "-" + "+" + "|" + "^" + "*" + "/" + "%" + "~/" + "^/" + "~%" + "^%" + "/%" + "&" + "~" +] @operator + +; Keywords + +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "try" + "type" +] @keyword + +[ + "return" +] @keyword.return + +; Conditionals + +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @conditional + +; Exceptions + +[ + "catch" +] @exception + +; Repeats + +[ + "do" + "forall" + "repeat" + "while" +] @repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @type.qualifier + +; Literals + +[ + (string) + (asm_instruction) +] @string + +[ + (string_type) + (underscore) +] @character.special + +(number) @number + +; Punctuation + +["{" "}"] @punctuation.bracket + +["(" ")"] @punctuation.bracket + +["[" "]"] @punctuation.bracket + +[ + ";" + "," + "->" +] @punctuation.delimiter + +; Comments + +(comment) @comment @spell |
