Debian Codegraph @

runtime/queries/php-only/highlights.scm

raw symbols SCIP
1 (php_tag) @tag
2 (php_end_tag) @tag
3
4 ; Variables
5
6 (variable_name) @variable
7
8 (relative_scope) @variable.builtin
9
10 ((name) @constant
11 (#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
12 ((name) @constant.builtin
13 (#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
14
15 ((name) @constructor
16 (#match? @constructor "^[A-Z]"))
17
18 ((name) @variable.builtin
19 (#eq? @variable.builtin "this"))
20
21 ; Types
22
23 (primitive_type) @type.builtin
24 (cast_type) @type.builtin
25 (named_type (name) @type) @type
26 (named_type (qualified_name) @type) @type
27
28 ; Functions
29
30 (array_creation_expression "array" @function.builtin)
31 (list_literal "list" @function.builtin)
32
33 (method_declaration
34 name: (name) @function.method)
35
36 (function_call_expression
37 function: [(qualified_name (name)) (name)] @function)
38
39 (scoped_call_expression
40 name: (name) @function)
41
42 (member_call_expression
43 name: (name) @function.method)
44
45 (function_definition
46 name: (name) @function)
47
48 ; Property hooks (PHP 8.4): `get`/`set` parse as a plain `name`; anchor to the
49 ; first child so names in the hook body aren't caught.
50 (property_hook . (name) @keyword)
51
52 ; Member
53
54 (property_element
55 (variable_name) @variable.other.member)
56
57 (member_access_expression
58 name: (variable_name (name)) @variable.other.member)
59 (member_access_expression
60 name: (name) @variable.other.member)
61
62 ; Basic tokens
63 [
64 (string)
65 (string_content)
66 (encapsed_string)
67 (heredoc)
68 (heredoc_body)
69 (nowdoc_body)
70 ] @string
71 (boolean) @constant.builtin.boolean
72 (null) @constant.builtin
73 (integer) @constant.numeric.integer
74 (float) @constant.numeric.float
75 (comment) @comment
76
77 "$" @operator
78
79 ; Keywords
80
81 "abstract" @keyword
82 "as" @keyword
83 "break" @keyword
84 "case" @keyword
85 "catch" @keyword.control.exception
86 "class" @keyword
87 "const" @keyword
88 "continue" @keyword
89 "declare" @keyword
90 "default" @keyword
91 "do" @keyword
92 "echo" @keyword
93 "else" @keyword
94 "elseif" @keyword
95 "enddeclare" @keyword
96 "endforeach" @keyword
97 "endif" @keyword
98 "endswitch" @keyword
99 "endwhile" @keyword
100 "extends" @keyword
101 "final" @keyword
102 "finally" @keyword.control.exception
103 "for" @keyword
104 "foreach" @keyword
105 "function" @keyword.function
106 "global" @keyword
107 "if" @keyword
108 "implements" @keyword
109 "include_once" @keyword
110 "include" @keyword
111 "insteadof" @keyword
112 "interface" @keyword
113 "namespace" @keyword
114 "new" @keyword
115 "private" @keyword
116 "protected" @keyword
117 "public" @keyword
118 "require_once" @keyword
119 "require" @keyword
120 "return" @keyword.control.return
121 "static" @keyword
122 "switch" @keyword
123 "throw" @keyword.control.exception
124 "trait" @keyword
125 "try" @keyword.control.exception
126 "use" @keyword
127 "while" @keyword