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 "class"
110 "concept"
111 "consteval"
112 "constexpr"
113 "constinit"
114 "decltype"
115 "delete"
116 "enum"
117 "explicit"
118 "export"
119 "extern"
120 "final"
121 "friend"
122 "import"
123 "inline"
124 "module"
125 "namespace"
126 "new"
127 "noexcept"
128 "operator"
129 "override"
130 "private"
131 "protected"
132 "public"
133 "requires"
134 "sizeof"
135 "struct"
136 "template"
137 "thread_local"
138 "typedef"
139 "typename"
140 "union"
141 "using"
142 "virtual"
143 (storage_class_specifier)
144 (type_qualifier)
145] @keyword
146
147[
148 "break"
149 "case"
150 "catch"
151 "co_await"
152 "co_return"
153 "co_yield"
154 "continue"
155 "default"
156 "do"
157 "else"
158 "for"
159 "goto"
160 "if"
161 "return"
162 "switch"
163 "throw"
164 "try"
165 "while"
166] @keyword.control
167
168[
169 "#define"
170 "#elif"
171 "#else"
172 "#endif"
173 "#if"
174 "#ifdef"
175 "#ifndef"
176 "#include"
177 (preproc_directive)
178] @keyword.directive
179
180(comment) @comment
181
182[
183 (true)
184 (false)
185] @boolean
186
187[
188 (null)
189 ("nullptr")
190] @constant.builtin
191
192(number_literal) @number
193
194[
195 (string_literal)
196 (system_lib_string)
197 (char_literal)
198 (raw_string_literal)
199] @string
200
201[
202 ","
203 ":"
204 "::"
205 ";"
206 (raw_string_delimiter)
207] @punctuation.delimiter
208
209[
210 "{"
211 "}"
212 "("
213 ")"
214 "["
215 "]"
216] @punctuation.bracket
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 "<="
255 ">="
256 "?"
257 "and"
258 "and_eq"
259 "bitand"
260 "bitor"
261 "compl"
262 "not"
263 "not_eq"
264 "or"
265 "or_eq"
266 "xor"
267 "xor_eq"
268] @operator
269
270"<=>" @operator.spaceship
271
272(binary_expression
273 operator: "<=>" @operator.spaceship)
274
275(conditional_expression ":" @operator)
276(user_defined_literal (literal_suffix) @operator)