chore: updated c,c++ highlights (#13747)

pull/13484/merge
CalebLarsen 2025-06-12 09:28:09 -05:00 committed by GitHub
parent 3b7aaddb13
commit 62f270e5d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 16 deletions

View File

@ -14,8 +14,6 @@
] @keyword.storage.type ] @keyword.storage.type
[ [
"extern"
"register"
(type_qualifier) (type_qualifier)
(storage_class_specifier) (storage_class_specifier)
] @keyword.storage.modifier ] @keyword.storage.modifier
@ -55,8 +53,11 @@
(preproc_directive) (preproc_directive)
] @keyword.directive ] @keyword.directive
(pointer_declarator "*" @type.builtin) "..." @punctuation
(abstract_pointer_declarator "*" @type.builtin)
["," "." ":" "::" ";" "->"] @punctuation.delimiter
["(" ")" "[" "]" "{" "}" "[[" "]]"] @punctuation.bracket
[ [
"+" "+"
@ -95,13 +96,11 @@
"?" "?"
] @operator ] @operator
(conditional_expression ":" @operator) (conditional_expression ":" @operator) ; After punctuation
"..." @punctuation (pointer_declarator "*" @type.builtin) ; After Operators
(abstract_pointer_declarator "*" @type.builtin)
["," "." ":" ";" "->" "::"] @punctuation.delimiter
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
[(true) (false)] @constant.builtin.boolean [(true) (false)] @constant.builtin.boolean

View File

@ -23,11 +23,6 @@
; Functions ; Functions
; These casts are parsed as function calls, but are not.
((identifier) @keyword (#eq? @keyword "static_cast"))
((identifier) @keyword (#eq? @keyword "dynamic_cast"))
((identifier) @keyword (#eq? @keyword "reinterpret_cast"))
((identifier) @keyword (#eq? @keyword "const_cast"))
(call_expression (call_expression
function: (qualified_identifier function: (qualified_identifier
@ -39,6 +34,8 @@
(template_method (template_method
name: (field_identifier) @function) name: (field_identifier) @function)
; Support up to 3 levels of nesting of qualifiers
; i.e. a::b::c::func();
(function_declarator (function_declarator
declarator: (qualified_identifier declarator: (qualified_identifier
name: (identifier) @function)) name: (identifier) @function))
@ -48,6 +45,12 @@
name: (qualified_identifier name: (qualified_identifier
name: (identifier) @function))) name: (identifier) @function)))
(function_declarator
declarator: (qualified_identifier
name: (qualified_identifier
name: (qualified_identifier
name: (identifier) @function))))
(function_declarator (function_declarator
declarator: (field_identifier) @function) declarator: (field_identifier) @function)
@ -72,6 +75,13 @@
"()" "()"
] @operator ] @operator
; These casts are parsed as function calls, but are not.
((identifier) @keyword (#eq? @keyword "static_cast"))
((identifier) @keyword (#eq? @keyword "dynamic_cast"))
((identifier) @keyword (#eq? @keyword "reinterpret_cast"))
((identifier) @keyword (#eq? @keyword "const_cast"))
[ [
"co_await" "co_await"
"co_return" "co_return"

View File

@ -131,8 +131,8 @@
"try" "try"
"except" "except"
"finally" "finally"
] @keyword.control.except ] @keyword.control.exception
(raise_statement "from" @keyword.control.except) (raise_statement "from" @keyword.control.exception)
; Functions ; Functions
[ [