summaryrefslogtreecommitdiff
path: root/web/assets/cpp.scm
blob: e939a7ad03f420fa796e5718cf101e36b8095a60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; C++ highlights, from tree-sitter/tree-sitter-cpp v0.23.4
; queries/highlights.scm (MIT). A supplement loaded after c.scm, as upstream
; composes it, so these patterns win. Capture names mapped onto zed syntax
; keys; `this` gets @variable.special to match what rust.scm does for `self`.

["catch" "class" "co_await" "co_return" "co_yield" "constexpr" "constinit"
 "consteval" "delete" "explicit" "final" "friend" "mutable" "namespace"
 "noexcept" "new" "override" "private" "protected" "public" "template"
 "throw" "try" "typename" "using" "concept" "requires" "virtual"] @keyword

(auto) @type
((namespace_identifier) @type
 (#match? @type "^[A-Z]"))

(call_expression function: (qualified_identifier
  name: (identifier) @function))
(template_function name: (identifier) @function)
(template_method name: (field_identifier) @function.method)
(function_declarator declarator: (qualified_identifier
  name: (identifier) @function))
(function_declarator declarator: (field_identifier) @function.method)

(raw_string_literal) @string
(this) @variable.special
(null "nullptr" @constant)