Skip to content

Commit

Permalink
[tree-sitter] Add highlights for C++ destructors…
Browse files Browse the repository at this point in the history
…and for the `class` keyword, whose omission is a strange oversight.
  • Loading branch information
savetheclocktower committed Oct 31, 2023
1 parent 80126cd commit e2acf70
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/language-c/grammars/tree-sitter-cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
(function_declarator
(identifier) @entity.name.function.cpp)

(function_declarator
(destructor_name
(identifier) @entity.name.function.cpp))

; The "foo" in `void Bar::foo () {`.
(function_declarator
declarator: (qualified_identifier
Expand Down Expand Up @@ -339,6 +343,7 @@
"throw"
"using"
"namespace"
"class"
] @keyword.control._TYPE_.cpp

; OPERATORS
Expand All @@ -348,6 +353,7 @@
(abstract_pointer_declarator "*" @keyword.operator.pointer.cpp)
(pointer_expression "*" @keyword.operator.pointer.cpp)

(destructor_name "~" @keyword.operator.destructor.cpp)

"sizeof" @keyword.operator.sizeof.cpp
(pointer_expression "&" @keyword.operator.pointer.cpp)
Expand Down

0 comments on commit e2acf70

Please sign in to comment.