From ac1742436c2453820c406060cff59579f6906cef Mon Sep 17 00:00:00 2001 From: Caleb White Date: Tue, 19 Mar 2024 09:03:05 -0500 Subject: [PATCH] chore(php): move keywords to top of queries --- queries/php_only/highlights.scm | 334 ++++++++++++++++---------------- 1 file changed, 167 insertions(+), 167 deletions(-) diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm index e8b4a7825..2ef9ea38f 100644 --- a/queries/php_only/highlights.scm +++ b/queries/php_only/highlights.scm @@ -1,3 +1,170 @@ +; Keywords +[ + "and" + "as" + "instanceof" + "or" + "xor" +] @keyword.operator + +[ + "fn" + "function" +] @keyword.function + +[ + "break" + "class" + "clone" + "declare" + "default" + "echo" + "enddeclare" + "enum" + "extends" + "global" + "goto" + "implements" + "insteadof" + "interface" + "print" + "namespace" + "new" + "trait" + "unset" +] @keyword + +[ + "abstract" + "const" + "final" + "private" + "protected" + "public" + "readonly" + (static_modifier) +] @keyword.modifier + +(function_static_declaration + "static" @keyword.modifier) + +[ + "return" + "exit" + "yield" +] @keyword.return + +(yield_expression + "from" @keyword.return) + +[ + "case" + "else" + "elseif" + "endif" + "endswitch" + "if" + "switch" + "match" + "??" +] @keyword.conditional + +[ + "continue" + "do" + "endfor" + "endforeach" + "endwhile" + "for" + "foreach" + "while" +] @keyword.repeat + +[ + "catch" + "finally" + "throw" + "try" +] @keyword.exception + +[ + "include_once" + "include" + "require_once" + "require" + "use" +] @keyword.import + +[ + "," + ";" + ":" + "\\" +] @punctuation.delimiter + +[ + (php_tag) + "?>" + "(" + ")" + "[" + "]" + "{" + "}" + "#[" +] @punctuation.bracket + +[ + "=" + "." + "-" + "*" + "/" + "+" + "%" + "**" + "~" + "|" + "^" + "&" + "<<" + ">>" + "<<<" + "->" + "?->" + "=>" + "<" + "<=" + ">=" + ">" + "<>" + "<=>" + "==" + "!=" + "===" + "!==" + "!" + "&&" + "||" + ".=" + "-=" + "+=" + "*=" + "/=" + "%=" + "**=" + "&=" + "|=" + "^=" + "<<=" + ">>=" + "??=" + "--" + "++" + "@" + "::" +] @operator + ; Variables (variable_name) @variable @@ -235,170 +402,3 @@ (comment) @comment @spell (named_label_statement) @label - -; Keywords -[ - "and" - "as" - "instanceof" - "or" - "xor" -] @keyword.operator - -[ - "fn" - "function" -] @keyword.function - -[ - "break" - "class" - "clone" - "declare" - "default" - "echo" - "enddeclare" - "enum" - "extends" - "global" - "goto" - "implements" - "insteadof" - "interface" - "print" - "namespace" - "new" - "trait" - "unset" -] @keyword - -[ - "abstract" - "const" - "final" - "private" - "protected" - "public" - "readonly" - (static_modifier) -] @keyword.modifier - -(function_static_declaration - "static" @keyword.modifier) - -[ - "return" - "exit" - "yield" -] @keyword.return - -(yield_expression - "from" @keyword.return) - -[ - "case" - "else" - "elseif" - "endif" - "endswitch" - "if" - "switch" - "match" - "??" -] @keyword.conditional - -[ - "continue" - "do" - "endfor" - "endforeach" - "endwhile" - "for" - "foreach" - "while" -] @keyword.repeat - -[ - "catch" - "finally" - "throw" - "try" -] @keyword.exception - -[ - "include_once" - "include" - "require_once" - "require" - "use" -] @keyword.import - -[ - "," - ";" - ":" - "\\" -] @punctuation.delimiter - -[ - (php_tag) - "?>" - "(" - ")" - "[" - "]" - "{" - "}" - "#[" -] @punctuation.bracket - -[ - "=" - "." - "-" - "*" - "/" - "+" - "%" - "**" - "~" - "|" - "^" - "&" - "<<" - ">>" - "<<<" - "->" - "?->" - "=>" - "<" - "<=" - ">=" - ">" - "<>" - "<=>" - "==" - "!=" - "===" - "!==" - "!" - "&&" - "||" - ".=" - "-=" - "+=" - "*=" - "/=" - "%=" - "**=" - "&=" - "|=" - "^=" - "<<=" - ">>=" - "??=" - "--" - "++" - "@" - "::" -] @operator