diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-05-13 01:26:02 -0400 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-05-13 02:11:04 -0400 |
| commit | a67a4ab6423d28d075e6054e9d0c5cef80b5acab (patch) | |
| tree | 4f81b38763f12c43fe747e7534a825755f60b71c /queries/func | |
| parent | fix(nickel): wrong indent on line after top level comment (#4792) (diff) | |
| download | nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar.gz nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar.bz2 nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar.lz nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar.xz nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.tar.zst nvim-treesitter-a67a4ab6423d28d075e6054e9d0c5cef80b5acab.zip | |
feat(func): update highlights
Diffstat (limited to 'queries/func')
| -rw-r--r-- | queries/func/highlights.scm | 139 |
1 files changed, 60 insertions, 79 deletions
diff --git a/queries/func/highlights.scm b/queries/func/highlights.scm index bda9e2ec1..c1662a180 100644 --- a/queries/func/highlights.scm +++ b/queries/func/highlights.scm @@ -16,54 +16,84 @@ "test-version-set" ] @preproc) -; Functions/Methods +; Keywords -(function_definition - name: (function_name) @function) +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "type" +] @keyword -(function_application - function: (identifier) @function) +[ + "return" +] @keyword.return -(method_call - method_name: (identifier) @method.call) +; Conditionals -; Parameters +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @conditional -(parameter) @parameter +; Exceptions -(function_application - arguments: [(identifier) (underscore)] @parameter) -(function_application - arguments: (tensor_expression - (identifier) @parameter)) -(function_application - arguments: (parenthesized_expression - (identifier) @parameter)) +[ + "try" + "catch" +] @exception -(method_call - arguments: [(identifier) (underscore)] @parameter) -(method_call - arguments: (tensor_expression - (identifier) @parameter)) -(method_call - arguments: (parenthesized_expression - (identifier) @parameter)) +; Repeats + +[ + "do" + "forall" + "repeat" + "while" +] @repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @type.qualifier + +; Variables + +(identifier) @variable ; Constants (const_var_declarations name: (identifier) @constant) -(unit_literal) @constant.builtin -; Variables +; Functions/Methods -(identifier) @variable +(function_definition + name: (function_name) @function) + +(function_application + function: (identifier) @function) + +(method_call + method_name: (identifier) @method.call) + +; Parameters + +(parameter) @parameter ; Types (type_identifier) @type + (primitive_type) @type.builtin -(unit_type) @type.builtin ; Operators @@ -112,55 +142,6 @@ "~" ] @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 [ @@ -179,7 +160,7 @@ ["{" "}"] @punctuation.bracket -["(" ")"] @punctuation.bracket +["(" ")" "()"] @punctuation.bracket ["[" "]"] @punctuation.bracket |
