highlights.scm

  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; GNU __attribute__
 97(attribute_specifier) @attribute
 98(attribute_specifier
 99  (argument_list
100    (identifier) @attribute))
101
102; C++11 [[attributes]]
103(attribute
104  prefix: (identifier) @attribute)
105(attribute
106  name: (identifier) @attribute)
107
108((identifier) @constant.builtin
109 (#match? @constant.builtin "^_*[A-Z][A-Z\\d_]*$"))
110
111(statement_identifier) @label
112(this) @variable.builtin
113("static_assert") @function.builtin
114
115[
116  "alignas"
117  "alignof"
118  "class"
119  "concept"
120  "consteval"
121  "constexpr"
122  "constinit"
123  "decltype"
124  "delete"
125  "enum"
126  "explicit"
127  "export"
128  "extern"
129  "final"
130  "friend"
131  "import"
132  "inline"
133  "module"
134  "namespace"
135  "new"
136  "noexcept"
137  "operator"
138  "override"
139  "private"
140  "protected"
141  "public"
142  "requires"
143  "sizeof"
144  "struct"
145  "template"
146  "thread_local"
147  "typedef"
148  "typename"
149  "union"
150  "using"
151  "virtual"
152  (storage_class_specifier)
153  (type_qualifier)
154] @keyword
155
156[
157  "break"
158  "case"
159  "catch"
160  "co_await"
161  "co_return"
162  "co_yield"
163  "continue"
164  "default"
165  "do"
166  "else"
167  "for"
168  "goto"
169  "if"
170  "return"
171  "switch"
172  "throw"
173  "try"
174  "while"
175] @keyword.control
176
177[
178  "#define"
179  "#elif"
180  "#elifdef"
181  "#elifndef"
182  "#else"
183  "#endif"
184  "#if"
185  "#ifdef"
186  "#ifndef"
187  "#include"
188  (preproc_directive)
189] @preproc
190
191(comment) @comment
192
193[
194  (true)
195  (false)
196] @boolean
197
198[
199  (null)
200  ("nullptr")
201] @constant.builtin
202
203(number_literal) @number
204
205[
206  (string_literal)
207  (system_lib_string)
208  (char_literal)
209  (raw_string_literal)
210] @string
211
212(escape_sequence) @string.escape
213
214[
215  ","
216  ":"
217  "::"
218  ";"
219  (raw_string_delimiter)
220] @punctuation.delimiter
221
222[
223  "{"
224  "}"
225  "("
226  ")"
227  "["
228  "]"
229] @punctuation.bracket
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  "/="
258  "%"
259  "%="
260  "<<"
261  "<<="
262  ">>"
263  ">>="
264  "<"
265  "=="
266  ">"
267  "<="
268  ">="
269  "?"
270  "and"
271  "and_eq"
272  "bitand"
273  "bitor"
274  "compl"
275  "not"
276  "not_eq"
277  "or"
278  "or_eq"
279  "xor"
280  "xor_eq"
281] @operator
282
283"<=>" @operator.spaceship
284
285(binary_expression
286  operator: "<=>" @operator.spaceship)
287
288(conditional_expression ":" @operator)
289(user_defined_literal (literal_suffix) @operator)