1(identifier) @variable
2(field_identifier) @property
3(namespace_identifier) @namespace
4
5(concept_definition
6 name: (identifier) @concept)
7
8(requires_clause
9 constraint: (template_type
10 name: (type_identifier) @concept))
11
12(module_name
13 (identifier) @module)
14
15(module_declaration
16 name: (module_name
17 (identifier) @module))
18
19(import_declaration
20 name: (module_name
21 (identifier) @module))
22
23(import_declaration
24 partition: (module_partition
25 (module_name
26 (identifier) @module)))
27
28(call_expression
29 function: (qualified_identifier
30 name: (identifier) @function))
31
32(call_expression
33 (qualified_identifier
34 (identifier) @function.call))
35
36(call_expression
37 (qualified_identifier
38 (qualified_identifier
39 (identifier) @function.call)))
40
41(call_expression
42 (qualified_identifier
43 (qualified_identifier
44 (qualified_identifier
45 (identifier) @function.call))))
46
47((qualified_identifier
48 (qualified_identifier
49 (qualified_identifier
50 (qualified_identifier
51 (identifier) @function.call)))) @_parent
52 (#has-ancestor? @_parent call_expression))
53
54(call_expression
55 function: (identifier) @function)
56
57(call_expression
58 function: (field_expression
59 field: (field_identifier) @function))
60
61(preproc_function_def
62 name: (identifier) @function.special)
63
64(template_function
65 name: (identifier) @function)
66
67(template_method
68 name: (field_identifier) @function)
69
70(function_declarator
71 declarator: (identifier) @function)
72
73(function_declarator
74 declarator: (qualified_identifier
75 name: (identifier) @function))
76
77(function_declarator
78 declarator: (field_identifier) @function)
79
80(operator_name
81 (identifier)? @operator) @function
82
83(operator_name
84 "<=>" @operator.spaceship)
85
86(destructor_name (identifier) @function)
87
88((namespace_identifier) @type
89 (#match? @type "^[A-Z]"))
90
91(auto) @type
92(type_identifier) @type
93type: (primitive_type) @type.builtin
94(sized_type_specifier) @type.builtin
95
96(attribute
97 name: (identifier) @attribute)
98
99((identifier) @constant.builtin
100 (#match? @constant.builtin "^_*[A-Z][A-Z\\d_]*$"))
101
102(statement_identifier) @label
103(this) @variable.builtin
104("static_assert") @function.builtin
105
106[
107 "alignas"
108 "alignof"
109 "break"
110 "case"
111 "catch"
112 "class"
113 "co_await"
114 "co_return"
115 "co_yield"
116 "concept"
117 "consteval"
118 "constexpr"
119 "constinit"
120 "continue"
121 "decltype"
122 "default"
123 "delete"
124 "do"
125 "else"
126 "enum"
127 "explicit"
128 "export"
129 "extern"
130 "final"
131 "for"
132 "friend"
133 "goto"
134 "if"
135 "import"
136 "inline"
137 "module"
138 "namespace"
139 "new"
140 "noexcept"
141 "operator"
142 "override"
143 "private"
144 "protected"
145 "public"
146 "requires"
147 "return"
148 "sizeof"
149 "struct"
150 "switch"
151 "template"
152 "thread_local"
153 "throw"
154 "try"
155 "typedef"
156 "typename"
157 "union"
158 "using"
159 "virtual"
160 "while"
161 (storage_class_specifier)
162 (type_qualifier)
163] @keyword
164
165[
166 "#define"
167 "#elif"
168 "#else"
169 "#endif"
170 "#if"
171 "#ifdef"
172 "#ifndef"
173 "#include"
174 (preproc_directive)
175] @keyword.directive
176
177(comment) @comment
178
179[
180 (true)
181 (false)
182] @boolean
183
184[
185 (null)
186 ("nullptr")
187] @constant.builtin
188
189(number_literal) @number
190
191[
192 (string_literal)
193 (system_lib_string)
194 (char_literal)
195 (raw_string_literal)
196] @string
197
198[
199 ","
200 ":"
201 "::"
202 ";"
203 (raw_string_delimiter)
204] @punctuation.delimiter
205
206[
207 "{"
208 "}"
209 "("
210 ")"
211 "["
212 "]"
213] @punctuation.bracket
214
215[
216 "."
217 ".*"
218 "->*"
219 "~"
220 "-"
221 "--"
222 "-="
223 "->"
224 "="
225 "!"
226 "!="
227 "|"
228 "|="
229 "||"
230 "^"
231 "^="
232 "&"
233 "&="
234 "&&"
235 "+"
236 "++"
237 "+="
238 "*"
239 "*="
240 "/"
241 "/="
242 "%"
243 "%="
244 "<<"
245 "<<="
246 ">>"
247 ">>="
248 "<"
249 "=="
250 ">"
251 "<="
252 ">="
253 "?"
254 "and"
255 "and_eq"
256 "bitand"
257 "bitor"
258 "compl"
259 "not"
260 "not_eq"
261 "or"
262 "or_eq"
263 "xor"
264 "xor_eq"
265] @operator
266
267"<=>" @operator.spaceship
268
269(binary_expression
270 operator: "<=>" @operator.spaceship)
271
272(conditional_expression ":" @operator)
273(user_defined_literal (literal_suffix) @operator)