aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/query/highlights.scm
blob: cdedb23e29f7181c77b5534a9a0cfa7628c2a8df (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
(string) @string

(escape_sequence) @string.escape

(capture
  (identifier) @type)

(anonymous_node
  (identifier) @string)

(predicate
  name: (identifier) @function.call)

(named_node
  name: (identifier) @variable)

(field_definition
  name: (identifier) @property)

(negated_field
  "!" @operator
  (identifier) @property)

(comment) @comment @spell

(quantifier) @operator

(predicate_type) @punctuation.special

"." @operator

[
  "["
  "]"
  "("
  ")"
] @punctuation.bracket

":" @punctuation.delimiter

[
  "@"
  "#"
] @punctuation.special

"_" @constant

((parameters
  (identifier) @number)
  (#match? @number "^[-+]?[0-9]+(.[0-9]+)?$"))

((program
  .
  (comment)*
  .
  (comment) @keyword.import)
  (#lua-match? @keyword.import "^;+ *inherits *:"))

((program
  .
  (comment)*
  .
  (comment) @keyword.directive)
  (#lua-match? @keyword.directive "^;+ *extends *$"))

((comment) @keyword.directive
  (#lua-match? @keyword.directive "^;+%s*format%-ignore%s*$"))

((predicate
  name: (identifier) @_name
  parameters:
    (parameters
      (string
        "\"" @string
        "\"" @string) @string.regexp))
  (#any-of? @_name "match" "not-match" "vim-match" "not-vim-match" "lua-match" "not-lua-match"))

((predicate
  name: (identifier) @_name
  parameters:
    (parameters
      (string
        "\"" @string
        "\"" @string) @string.regexp
      .
      (string) .))
  (#any-of? @_name "gsub" "not-gsub"))