From a67a4ab6423d28d075e6054e9d0c5cef80b5acab Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 13 May 2023 01:26:02 -0400 Subject: [PATCH] feat(func): update highlights --- queries/func/highlights.scm | 139 ++++++++++++++++-------------------- 1 file 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,6 +16,64 @@ "test-version-set" ] @preproc) +; Keywords + +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "type" +] @keyword + +[ + "return" +] @keyword.return + +; Conditionals + +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @conditional + +; Exceptions + +[ + "try" + "catch" +] @exception + +; Repeats + +[ + "do" + "forall" + "repeat" + "while" +] @repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @type.qualifier + +; Variables + +(identifier) @variable + +; Constants + +(const_var_declarations + name: (identifier) @constant) + ; Functions/Methods (function_definition @@ -31,39 +89,11 @@ (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 @@ -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