on aef00a3 help sign in
helix/runtime/queries/php/highlights.scm
129 lines 2.1 kB history raw
1(php_tag) @tag
2"?>" @tag
4; Types
6(primitive_type) @type.builtin
7(cast_type) @type.builtin
8(named_type (name) @type) @type
9(named_type (qualified_name) @type) @type
11(namespace_definition
12 name: (namespace_name (name) @namespace))
14; Superglobals
15(subscript_expression
16 (variable_name(name) @constant.builtin
17 (#match? @constant.builtin "^_?[A-Z][A-Z\\d_]+$")))
19; Functions
21(array_creation_expression "array" @function.builtin)
22(list_literal "list" @function.builtin)
24(method_declaration
25 name: (name) @function.method)
27(function_call_expression
28 function: (_) @function)
30(scoped_call_expression
31 name: (name) @function)
33(member_call_expression
34 name: (name) @function.method)
36(function_definition
37 name: (name) @function)
40; Member
42(property_element
43 (variable_name) @variable.other.member)
45(member_access_expression
46 name: (variable_name (name)) @variable.other.member)
47(member_access_expression
48 name: (name) @variable.other.member)
50; Variables
52(relative_scope) @variable.builtin
54((name) @constant
55 (#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
57((name) @constructor
58 (#match? @constructor "^[A-Z]"))
60((name) @variable.builtin
61 (#eq? @variable.builtin "this"))
63(variable_name) @variable
65; Basic tokens
67(string) @string
68(heredoc) @string
69(boolean) @constant.builtin.boolean
70(null) @constant.builtin
71(integer) @constant.numeric.integer
72(float) @constant.numeric.float
73(comment) @comment
75"$" @operator
77; Keywords
80 "abstract"
81 "as"
82 "break"
83 "case"
84 "catch"
85 "class"
86 "const"
87 "continue"
88 "declare"
89 "default"
90 "do"
91 "echo"
92 "else"
93 "elseif"
94 "enddeclare"
95 "endforeach"
96 "endif"
97 "endswitch"
98 "endwhile"
99 "enum"
100 "extends"
101 "final"
102 "finally"
103 "foreach"
104 "fn"
105 "function"
106 "global"
107 "if"
108 "implements"
109 "include_once"
110 "include"
111 "insteadof"
112 "interface"
113 "match"
114 "namespace"
115 "new"
116 "private"
117 "protected"
118 "public"
119 "require_once"
120 "require"
121 "return"
122 "static"
123 "switch"
124 "throw"
125 "trait"
126 "try"
127 "use"
128 "while"
129] @keyword