Skip to content

Commit

Permalink
c/c++ highlights: *& are @type or @operator based on context (#4278)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-mccall authored Oct 15, 2022
1 parent 45e038f commit a3ed916
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/queries/c/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
(preproc_directive)
] @keyword.directive

(pointer_declarator "*" @type.builtin)
(abstract_pointer_declarator "*" @type.builtin)

[
"+"
"-"
Expand Down
4 changes: 4 additions & 0 deletions runtime/queries/cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
(auto) @type
"decltype" @type

(ref_qualifier ["&" "&&"] @type.builtin)
(reference_declarator ["&" "&&"] @type.builtin)
(abstract_reference_declarator ["&" "&&"] @type.builtin)

; Constants

(this) @variable.builtin
Expand Down

0 comments on commit a3ed916

Please sign in to comment.