2020-05-15 11:45:25 +02:00
|
|
|
"break" @keyword
|
|
|
|
|
"case" @conditional
|
|
|
|
|
"const" @keyword
|
|
|
|
|
"continue" @repeat
|
|
|
|
|
"default" @keyword
|
|
|
|
|
"do" @repeat
|
|
|
|
|
"else" @conditional
|
|
|
|
|
"enum" @keyword
|
|
|
|
|
"extern" @keyword
|
|
|
|
|
"for" @repeat
|
|
|
|
|
"if" @conditional
|
|
|
|
|
"inline" @keyword
|
|
|
|
|
"return" @keyword
|
|
|
|
|
"sizeof" @keyword
|
|
|
|
|
"static" @keyword
|
|
|
|
|
"struct" @keyword
|
|
|
|
|
"switch" @keyword
|
|
|
|
|
"typedef" @keyword
|
|
|
|
|
"union" @keyword
|
|
|
|
|
"volatile" @keyword
|
|
|
|
|
"while" @repeat
|
|
|
|
|
|
|
|
|
|
"#define" @constant.macro
|
2020-06-27 21:06:11 +02:00
|
|
|
[
|
|
|
|
|
"#if"
|
|
|
|
|
"#ifdef"
|
|
|
|
|
"#ifndef"
|
|
|
|
|
"#else"
|
|
|
|
|
"#elif"
|
|
|
|
|
"#endif"
|
|
|
|
|
"#include"
|
|
|
|
|
(preproc_directive)
|
|
|
|
|
] @keyword
|
2020-05-15 11:45:25 +02:00
|
|
|
|
|
|
|
|
"--" @operator
|
|
|
|
|
"-" @operator
|
|
|
|
|
"->" @operator
|
|
|
|
|
"!=" @operator
|
|
|
|
|
"*" @operator
|
2020-05-23 21:50:52 +02:00
|
|
|
"/" @operator
|
2020-05-15 11:45:25 +02:00
|
|
|
"&" @operator
|
|
|
|
|
"&&" @operator
|
|
|
|
|
"+" @operator
|
|
|
|
|
"++" @operator
|
|
|
|
|
"<" @operator
|
2020-05-23 21:50:52 +02:00
|
|
|
"<=" @operator
|
2020-05-15 11:45:25 +02:00
|
|
|
"==" @operator
|
2020-05-23 21:50:52 +02:00
|
|
|
"=" @operator
|
|
|
|
|
"~" @operator
|
2020-05-15 11:45:25 +02:00
|
|
|
">" @operator
|
2020-05-23 21:50:52 +02:00
|
|
|
">=" @operator
|
|
|
|
|
"!" @operator
|
2020-05-15 11:45:25 +02:00
|
|
|
"||" @operator
|
|
|
|
|
|
2020-05-24 13:31:13 +02:00
|
|
|
"-=" @operator
|
|
|
|
|
"+=" @operator
|
|
|
|
|
"*=" @operator
|
|
|
|
|
"/=" @operator
|
|
|
|
|
"|=" @operator
|
|
|
|
|
"&=" @operator
|
|
|
|
|
|
2020-05-23 21:59:34 +02:00
|
|
|
"." @punctuation.delimiter
|
|
|
|
|
";" @punctuation.delimiter
|
|
|
|
|
":" @punctuation.delimiter
|
|
|
|
|
"," @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
"(" @punctuation.bracket
|
|
|
|
|
")" @punctuation.bracket
|
|
|
|
|
"[" @punctuation.bracket
|
|
|
|
|
"]" @punctuation.bracket
|
|
|
|
|
"{" @punctuation.bracket
|
|
|
|
|
"}" @punctuation.bracket
|
2020-05-15 11:45:25 +02:00
|
|
|
|
|
|
|
|
(string_literal) @string
|
|
|
|
|
(system_lib_string) @string
|
|
|
|
|
|
|
|
|
|
(null) @constant.builtin
|
|
|
|
|
(number_literal) @number
|
|
|
|
|
(char_literal) @number
|
|
|
|
|
|
|
|
|
|
(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-05-24 13:40:43 +02:00
|
|
|
(preproc_arg) @function.macro
|
|
|
|
|
; TODO (preproc_arg) @embedded
|
2020-05-15 11:45:25 +02:00
|
|
|
|
|
|
|
|
(field_identifier) @property
|
|
|
|
|
(statement_identifier) @label
|
|
|
|
|
(type_identifier) @type
|
|
|
|
|
(primitive_type) @type
|
|
|
|
|
(sized_type_specifier) @type
|
|
|
|
|
|
2020-05-23 21:02:43 +02:00
|
|
|
((identifier) @type
|
2020-06-07 13:13:24 +02:00
|
|
|
(#match? @type "^[A-Z]"))
|
2020-05-23 21:02:43 +02:00
|
|
|
|
2020-05-15 11:45:25 +02:00
|
|
|
((identifier) @constant
|
2020-06-14 15:12:38 +02:00
|
|
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
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
|
|
|
|
|
(parameter_list
|
|
|
|
|
(parameter_declaration) @parameter)
|
|
|
|
|
|
2020-05-24 13:40:43 +02:00
|
|
|
(preproc_params
|
|
|
|
|
(identifier)) @parameter
|
|
|
|
|
|
2020-05-23 21:03:03 +02:00
|
|
|
(ERROR) @error
|
2020-06-07 13:13:24 +02:00
|
|
|
|