diff --git a/crates/languages/src/c/highlights.scm b/crates/languages/src/c/highlights.scm index 634f8d81c4ad93..a4e728c9be9bff 100644 --- a/crates/languages/src/c/highlights.scm +++ b/crates/languages/src/c/highlights.scm @@ -102,13 +102,16 @@ [ (true) (false) +] @boolean + +[ (null) -] @constant +] @constant.builtin (identifier) @variable -((identifier) @constant - (#match? @constant "^_*[A-Z][A-Z\\d_]*$")) +((identifier) @constant.variable + (#match? @constant.variable "^_*[A-Z][A-Z\\d_]*$")) (call_expression function: (identifier) @function) diff --git a/crates/languages/src/cpp/highlights.scm b/crates/languages/src/cpp/highlights.scm index 2df9ec2923be3d..89087f4ef726f7 100644 --- a/crates/languages/src/cpp/highlights.scm +++ b/crates/languages/src/cpp/highlights.scm @@ -77,8 +77,8 @@ type :(primitive_type) @type.primitive (attribute name: (identifier) @keyword) -((identifier) @constant - (#match? @constant "^_*[A-Z][A-Z\\d_]*$")) +((identifier) @constant.variable + (#match? @constant.variable "^_*[A-Z][A-Z\\d_]*$")) (statement_identifier) @label (this) @variable.special @@ -153,9 +153,12 @@ type :(primitive_type) @type.primitive [ (true) (false) +] @boolean + +[ (null) ("nullptr") -] @constant +] @constant.builtin (number_literal) @number