summaryrefslogtreecommitdiffstats
path: root/queries/php_only
diff options
context:
space:
mode:
authorCaleb White <cdwhite3@pm.me>2024-03-19 09:03:05 -0500
committerChristian Clason <c.clason@uni-graz.at>2024-03-27 08:29:44 +0100
commitac1742436c2453820c406060cff59579f6906cef (patch)
tree76b34a5c4409a39b36f5bb41db38ed161b47c0d1 /queries/php_only
parentchore(php): trim down tests (diff)
downloadnvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar.gz
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar.bz2
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar.lz
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar.xz
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.tar.zst
nvim-treesitter-ac1742436c2453820c406060cff59579f6906cef.zip
chore(php): move keywords to top of queries
Diffstat (limited to 'queries/php_only')
-rw-r--r--queries/php_only/highlights.scm334
1 files 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