aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/c
diff options
context:
space:
mode:
authorSam McCall2022-10-14 23:01:11 +0000
committerMichael Davis2022-10-15 14:33:43 +0000
commitaef37d43d7a943fdf58ade7df4d8defbef9a7ce0 (patch)
tree8add1264a501ec661c5afe65544aa428e59d9bdc /runtime/queries/c
parenta3ed9169df8d0a56ab4f698d2c90e7e6b4404633 (diff)
c/c++ highlighting: various tweaks
- treat `restrict`/`_Atomic` like `const`/`volatile` => @keyword.storage.modifier - highlight `unsigned int` as builtin => @type.builtin - recognize `static_cast` and friends => @keyword - `template` is a kind of entity like `typename` => @keyword.storage.type - many declaration modifiers have nothing to do with storage/types (explicit, friend, access specifiers, inline in C++) => @keyword - fix floats highlighted as integer => @constant.numeric
Diffstat (limited to 'runtime/queries/c')
-rw-r--r--runtime/queries/c/highlights.scm8
1 files changed, 3 insertions, 5 deletions
diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm
index fe5dacaf..8122216d 100644
--- a/runtime/queries/c/highlights.scm
+++ b/runtime/queries/c/highlights.scm
@@ -8,11 +8,9 @@
] @keyword.storage.type
[
- "const"
"extern"
- "inline"
"register"
- "volatile"
+ (type_qualifier)
(storage_class_specifier)
] @keyword.storage.modifier
@@ -107,7 +105,7 @@
(system_lib_string) @string
(null) @constant
-(number_literal) @constant.numeric.integer
+(number_literal) @constant.numeric
(char_literal) @constant.character
(call_expression
@@ -133,7 +131,7 @@
(statement_identifier) @label
(type_identifier) @type
(primitive_type) @type.builtin
-(sized_type_specifier) @type
+(sized_type_specifier) @type.builtin
((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$"))