2020-09-12 20:57:01 +02:00
|
|
|
(identifier) @variable
|
|
|
|
|
|
2020-08-15 09:24:24 -05:00
|
|
|
[
|
2020-07-04 22:00:59 +02:00
|
|
|
"const"
|
|
|
|
|
"default"
|
|
|
|
|
"enum"
|
|
|
|
|
"extern"
|
|
|
|
|
"inline"
|
|
|
|
|
"static"
|
|
|
|
|
"struct"
|
|
|
|
|
"typedef"
|
|
|
|
|
"union"
|
|
|
|
|
"volatile"
|
2020-07-16 09:30:15 +02:00
|
|
|
"goto"
|
2021-03-01 11:44:03 +01:00
|
|
|
"register"
|
2020-07-04 22:00:59 +02:00
|
|
|
] @keyword
|
|
|
|
|
|
2021-08-29 14:53:10 -05:00
|
|
|
"sizeof" @keyword.operator
|
2021-07-04 20:24:25 +03:00
|
|
|
"return" @keyword.return
|
2021-07-04 19:55:59 +03:00
|
|
|
|
2020-07-06 23:01:46 +02:00
|
|
|
[
|
2020-07-04 22:00:59 +02:00
|
|
|
"while"
|
|
|
|
|
"for"
|
|
|
|
|
"do"
|
|
|
|
|
"continue"
|
|
|
|
|
"break"
|
|
|
|
|
] @repeat
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"else"
|
|
|
|
|
"case"
|
2020-07-06 23:01:46 +02:00
|
|
|
"switch"
|
2020-07-04 22:00:59 +02:00
|
|
|
] @conditional
|
|
|
|
|
|
2020-05-15 11:45:25 +02:00
|
|
|
"#define" @constant.macro
|
2020-06-27 21:06:11 +02:00
|
|
|
[
|
|
|
|
|
"#if"
|
|
|
|
|
"#ifdef"
|
|
|
|
|
"#ifndef"
|
|
|
|
|
"#else"
|
|
|
|
|
"#elif"
|
|
|
|
|
"#endif"
|
|
|
|
|
(preproc_directive)
|
|
|
|
|
] @keyword
|
2020-05-15 11:45:25 +02:00
|
|
|
|
2020-09-12 20:10:43 +02:00
|
|
|
"#include" @include
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
[
|
2020-07-06 23:01:46 +02:00
|
|
|
"="
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
"-"
|
|
|
|
|
"*"
|
|
|
|
|
"/"
|
|
|
|
|
"+"
|
2020-07-20 08:56:27 +02:00
|
|
|
"%"
|
2020-07-06 23:01:46 +02:00
|
|
|
|
|
|
|
|
"~"
|
|
|
|
|
"|"
|
|
|
|
|
"&"
|
2020-08-27 01:17:44 +02:00
|
|
|
"^"
|
2020-07-06 23:01:46 +02:00
|
|
|
"<<"
|
|
|
|
|
">>"
|
|
|
|
|
|
|
|
|
|
"->"
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
"<"
|
|
|
|
|
"<="
|
|
|
|
|
">="
|
2020-07-06 23:01:46 +02:00
|
|
|
">"
|
|
|
|
|
"=="
|
|
|
|
|
"!="
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
"!"
|
2020-07-06 23:01:46 +02:00
|
|
|
"&&"
|
2020-07-04 22:00:59 +02:00
|
|
|
"||"
|
|
|
|
|
|
|
|
|
|
"-="
|
|
|
|
|
"+="
|
|
|
|
|
"*="
|
|
|
|
|
"/="
|
2020-07-20 08:56:27 +02:00
|
|
|
"%="
|
2020-07-04 22:00:59 +02:00
|
|
|
"|="
|
|
|
|
|
"&="
|
2020-08-27 01:17:44 +02:00
|
|
|
"^="
|
2021-01-06 16:41:57 +01:00
|
|
|
">>="
|
|
|
|
|
"<<="
|
2020-07-06 23:01:46 +02:00
|
|
|
"--"
|
|
|
|
|
"++"
|
2020-07-04 22:00:59 +02:00
|
|
|
] @operator
|
|
|
|
|
|
2020-07-06 23:01:46 +02:00
|
|
|
[
|
|
|
|
|
(true)
|
|
|
|
|
(false)
|
|
|
|
|
] @boolean
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
[ "." ";" ":" "," ] @punctuation.delimiter
|
2020-05-15 11:45:25 +02:00
|
|
|
|
2021-04-30 11:58:42 +02:00
|
|
|
"..." @punctuation.special
|
|
|
|
|
|
2020-07-06 23:01:46 +02:00
|
|
|
(conditional_expression [ "?" ":" ] @conditional)
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:00:59 +02:00
|
|
|
[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
2020-05-15 11:45:25 +02:00
|
|
|
|
|
|
|
|
(string_literal) @string
|
|
|
|
|
(system_lib_string) @string
|
2021-04-30 11:34:25 +02:00
|
|
|
(escape_sequence) @string.escape
|
2020-05-15 11:45:25 +02:00
|
|
|
|
|
|
|
|
(null) @constant.builtin
|
|
|
|
|
(number_literal) @number
|
2021-04-21 11:27:49 +02:00
|
|
|
(char_literal) @character
|
2020-05-15 11:45:25 +02:00
|
|
|
|
2020-08-30 01:14:18 +02:00
|
|
|
[
|
|
|
|
|
(preproc_arg)
|
|
|
|
|
(preproc_defined)
|
|
|
|
|
] @function.macro
|
2020-05-15 11:45:25 +02:00
|
|
|
|
2020-09-12 16:27:38 +02:00
|
|
|
(((field_expression
|
|
|
|
|
(field_identifier) @property)) @_parent
|
2020-11-18 19:07:24 +01:00
|
|
|
(#not-has-parent? @_parent template_method function_declarator call_expression))
|
2020-11-19 09:50:47 -06:00
|
|
|
|
|
|
|
|
(((field_identifier) @property)
|
|
|
|
|
(#has-ancestor? @property field_declaration)
|
|
|
|
|
(#not-has-ancestor? @property function_declarator))
|
|
|
|
|
|
2020-05-15 11:45:25 +02:00
|
|
|
(statement_identifier) @label
|
|
|
|
|
|
2020-07-06 23:01:46 +02:00
|
|
|
[
|
2021-09-17 01:01:28 +02:00
|
|
|
(type_identifier)
|
|
|
|
|
(primitive_type)
|
|
|
|
|
(sized_type_specifier)
|
|
|
|
|
(type_descriptor)
|
|
|
|
|
] @type
|
2020-07-06 23:01:46 +02:00
|
|
|
|
|
|
|
|
(sizeof_expression value: (parenthesized_expression (identifier) @type))
|
2020-05-23 21:02:43 +02:00
|
|
|
|
2020-05-15 11:45:25 +02:00
|
|
|
((identifier) @constant
|
2021-11-18 09:51:03 +00:00
|
|
|
(#lua-match? @constant "^[A-Z][A-Z0-9_]+$"))
|
2020-05-15 11:45:25 +02:00
|
|
|
|
2020-11-22 22:17:16 +01:00
|
|
|
;; Preproc def / undef
|
|
|
|
|
(preproc_def
|
|
|
|
|
name: (_) @constant)
|
|
|
|
|
(preproc_call
|
|
|
|
|
directive: (preproc_directive) @_u
|
|
|
|
|
argument: (_) @constant
|
|
|
|
|
(#eq? @_u "#undef"))
|
|
|
|
|
|
2021-07-01 15:16:23 -06:00
|
|
|
(call_expression
|
|
|
|
|
function: (identifier) @function)
|
|
|
|
|
(call_expression
|
|
|
|
|
function: (field_expression
|
|
|
|
|
field: (field_identifier) @function))
|
|
|
|
|
(function_declarator
|
|
|
|
|
declarator: (identifier) @function)
|
|
|
|
|
(preproc_function_def
|
|
|
|
|
name: (identifier) @function.macro)
|
2020-11-22 22:17:16 +01:00
|
|
|
|
2020-05-15 11:45:25 +02:00
|
|
|
(comment) @comment
|
2020-05-23 21:03:03 +02:00
|
|
|
|
2020-05-23 21:50:52 +02:00
|
|
|
;; Parameters
|
2020-08-15 09:24:24 -05:00
|
|
|
(parameter_declaration
|
|
|
|
|
declarator: (identifier) @parameter)
|
2020-05-23 21:50:52 +02:00
|
|
|
|
2020-08-22 21:17:07 +02:00
|
|
|
(parameter_declaration
|
|
|
|
|
declarator: (pointer_declarator) @parameter)
|
|
|
|
|
|
2021-11-13 14:37:06 -05:00
|
|
|
(preproc_params (identifier) @parameter)
|
2020-05-24 13:40:43 +02:00
|
|
|
|
2021-09-19 15:24:08 +02:00
|
|
|
[
|
|
|
|
|
"__attribute__"
|
|
|
|
|
"__cdecl"
|
|
|
|
|
"__clrcall"
|
|
|
|
|
"__stdcall"
|
|
|
|
|
"__fastcall"
|
|
|
|
|
"__thiscall"
|
|
|
|
|
"__vectorcall"
|
|
|
|
|
"_unaligned"
|
|
|
|
|
"__unaligned"
|
|
|
|
|
"__declspec"
|
|
|
|
|
] @attribute
|
|
|
|
|
|
2020-05-23 21:03:03 +02:00
|
|
|
(ERROR) @error
|