diff options
Diffstat (limited to 'queries/squirrel/highlights.scm')
| -rw-r--r-- | queries/squirrel/highlights.scm | 123 |
1 files changed, 72 insertions, 51 deletions
diff --git a/queries/squirrel/highlights.scm b/queries/squirrel/highlights.scm index e7ac9150e..66bc2247c 100644 --- a/queries/squirrel/highlights.scm +++ b/queries/squirrel/highlights.scm @@ -1,5 +1,4 @@ ; Keywords - [ "class" "clone" @@ -11,9 +10,7 @@ "var" ] @keyword -[ - "function" -] @keyword.function +"function" @keyword.function [ "in" @@ -27,12 +24,11 @@ ] @keyword.return ((global_variable - "::" - (_) @keyword.coroutine) + "::" + (_) @keyword.coroutine) (#any-of? @keyword.coroutine "suspend" "newthread")) ; Conditionals - [ "if" "else" @@ -43,7 +39,6 @@ ] @keyword.conditional ; Repeats - [ "for" "foreach" @@ -53,7 +48,6 @@ ] @keyword.repeat ; Exceptions - [ "try" "catch" @@ -61,26 +55,21 @@ ] @keyword.exception ; Storageclasses - -[ - "local" -] @keyword.storage +"local" @keyword.storage ; Qualifiers - [ "static" "const" ] @type.qualifier ; Variables - -(identifier) @variable +(identifier) @variable (local_declaration (identifier) @variable.local - . "=") - + . + "=") (global_variable) @variable.global @@ -88,58 +77,76 @@ (#any-of? @variable.builtin "base" "this" "vargv")) ; Parameters - (parameter - . (identifier) @variable.parameter) + . + (identifier) @variable.parameter) ; Properties (Slots) - (deref_expression "." - . (identifier) @property) + . + (identifier) @property) (member_declaration (identifier) @property - . "=") + . + "=") ((table_slot - . (identifier) @property - . ["=" ":"]) + . + (identifier) @property + . + [ + "=" + ":" + ]) (#set! "priority" 105)) ; Types - ((identifier) @type - (#lua-match? @type "^[A-Z]")) + (#lua-match? @type "^[A-Z]")) (class_declaration (identifier) @type - "extends"? . (identifier)? @type) + "extends"? + . + (identifier)? @type) (enum_declaration (identifier) @type) ; Attributes - (attribute_declaration left: (identifier) @attribute) ; Functions & Methods - (member_declaration (function_declaration - "::"? (_) @function.method . "(" (_)? ")")) + "::"? + (_) @function.method + . + "(" + (_)? + ")")) ((function_declaration - "::"? (_) @function . "(" (_)? ")") + "::"? + (_) @function + . + "(" + (_)? + ")") (#not-has-ancestor? @function member_declaration)) (call_expression function: (identifier) @function.call) (call_expression - function: (deref_expression - "." . (identifier) @function.call)) + function: + (deref_expression + "." + . + (identifier) @function.call)) (call_expression (global_variable @@ -152,11 +159,17 @@ (lambda_expression "@" @string.special.symbol)) -(call_expression +(call_expression [ - function: (identifier) @function.builtin - function: (global_variable "::" (_) @function.builtin) - function: (deref_expression "." (_) @function.builtin) + function: (identifier) @function.builtin + function: + (global_variable + "::" + (_) @function.builtin) + function: + (deref_expression + "." + (_) @function.builtin) ] ; format-ignore (#any-of? @function.builtin @@ -206,20 +219,20 @@ "constructor" @constructor) ; Constants - (const_declaration "const" - . (identifier) @constant) + . + (identifier) @constant) (enum_declaration "{" - . (identifier) @constant) + . + (identifier) @constant) ((identifier) @constant - (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$")) + (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$")) ; Operators - [ "+" "-" @@ -255,14 +268,25 @@ ] @operator ; Punctuation +[ + "{" + "}" +] @punctuation.bracket -[ "{" "}" ] @punctuation.bracket - -[ "[" "]" ] @punctuation.bracket +[ + "[" + "]" +] @punctuation.bracket -[ "(" ")" ] @punctuation.bracket +[ + "(" + ")" +] @punctuation.bracket -[ "</" "/>" ] @punctuation.bracket +[ + "</" + "/>" +] @punctuation.bracket [ "." @@ -277,13 +301,11 @@ ] @punctuation.special ; Ternaries - (ternary_expression "?" @keyword.conditional.ternary ":" @keyword.conditional.ternary) ; Literals - (string) @string (verbatim_string) @string.special @@ -301,7 +323,6 @@ (null) @constant.builtin ; Comments - (comment) @comment @spell ((comment) @comment.documentation |
