Skip to content

Commit a3ed916

Browse files
authored
c/c++ highlights: *& are @type or @operator based on context (#4278)
1 parent 45e038f commit a3ed916

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

runtime/queries/c/highlights.scm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
(preproc_directive)
5252
] @keyword.directive
5353

54+
(pointer_declarator "*" @type.builtin)
55+
(abstract_pointer_declarator "*" @type.builtin)
56+
5457
[
5558
"+"
5659
"-"

runtime/queries/cpp/highlights.scm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
(auto) @type
3535
"decltype" @type
3636

37+
(ref_qualifier ["&" "&&"] @type.builtin)
38+
(reference_declarator ["&" "&&"] @type.builtin)
39+
(abstract_reference_declarator ["&" "&&"] @type.builtin)
40+
3741
; Constants
3842

3943
(this) @variable.builtin

0 commit comments

Comments
 (0)