mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
highlight(c): fix booleans and types
This commit is contained in:
parent
a5fb463309
commit
7bb0d7548d
2 changed files with 41 additions and 20 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
"volatile"
|
"volatile"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
[
|
[
|
||||||
"while"
|
"while"
|
||||||
"for"
|
"for"
|
||||||
"do"
|
"do"
|
||||||
|
|
@ -25,11 +25,9 @@
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
"case"
|
"case"
|
||||||
"switch"
|
"switch"
|
||||||
] @conditional
|
] @conditional
|
||||||
|
|
||||||
(conditional_expression [ "?" ":" ] @conditional)
|
|
||||||
|
|
||||||
"#define" @constant.macro
|
"#define" @constant.macro
|
||||||
[
|
[
|
||||||
"#if"
|
"#if"
|
||||||
|
|
@ -43,24 +41,30 @@
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
[
|
[
|
||||||
"--"
|
"="
|
||||||
|
|
||||||
"-"
|
"-"
|
||||||
"->"
|
|
||||||
"!="
|
|
||||||
"*"
|
"*"
|
||||||
"/"
|
"/"
|
||||||
"&"
|
|
||||||
"&&"
|
|
||||||
"+"
|
"+"
|
||||||
"++"
|
|
||||||
|
"~"
|
||||||
|
"|"
|
||||||
|
"&"
|
||||||
|
"<<"
|
||||||
|
">>"
|
||||||
|
|
||||||
|
"->"
|
||||||
|
|
||||||
"<"
|
"<"
|
||||||
"<="
|
"<="
|
||||||
"=="
|
|
||||||
"="
|
|
||||||
"~"
|
|
||||||
">"
|
|
||||||
">="
|
">="
|
||||||
|
">"
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
|
||||||
"!"
|
"!"
|
||||||
|
"&&"
|
||||||
"||"
|
"||"
|
||||||
|
|
||||||
"-="
|
"-="
|
||||||
|
|
@ -69,10 +73,20 @@
|
||||||
"/="
|
"/="
|
||||||
"|="
|
"|="
|
||||||
"&="
|
"&="
|
||||||
|
"--"
|
||||||
|
"++"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
[ "." ";" ":" "," ] @punctuation.delimiter
|
[ "." ";" ":" "," ] @punctuation.delimiter
|
||||||
|
|
||||||
|
(conditional_expression [ "?" ":" ] @conditional)
|
||||||
|
|
||||||
|
|
||||||
[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
||||||
|
|
||||||
(string_literal) @string
|
(string_literal) @string
|
||||||
|
|
@ -96,12 +110,17 @@
|
||||||
|
|
||||||
(field_identifier) @property
|
(field_identifier) @property
|
||||||
(statement_identifier) @label
|
(statement_identifier) @label
|
||||||
(type_identifier) @type
|
|
||||||
(primitive_type) @type
|
|
||||||
(sized_type_specifier) @type
|
|
||||||
|
|
||||||
((identifier) @type
|
[
|
||||||
(#match? @type "^[A-Z]"))
|
(type_identifier)
|
||||||
|
(primitive_type)
|
||||||
|
(sized_type_specifier)
|
||||||
|
(type_descriptor)
|
||||||
|
] @type
|
||||||
|
|
||||||
|
(declaration type: [(identifier) (type_identifier)] @type)
|
||||||
|
(cast_expression type: [(identifier) (type_identifier)] @type)
|
||||||
|
(sizeof_expression value: (parenthesized_expression (identifier) @type))
|
||||||
|
|
||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
(namespace_identifier) @constant
|
(namespace_identifier) @constant
|
||||||
|
|
||||||
|
((identifier) @type (#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
((namespace_identifier) @type
|
((namespace_identifier) @type
|
||||||
(#match? @type "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
((namespace_identifier) @constant
|
((namespace_identifier) @constant
|
||||||
|
|
@ -77,7 +79,7 @@
|
||||||
"noexcept"
|
"noexcept"
|
||||||
"throw"
|
"throw"
|
||||||
] @exception
|
] @exception
|
||||||
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"class"
|
"class"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue