summaryrefslogtreecommitdiff
path: root/runtime/queries/cue/highlights.scm
blob: aef016e8b35a7484f74e64237994bb677deca470 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
(package_clause "package" @keyword.control.import)

(package_identifier) @variable

(import_declaration "import" @keyword.control.import)

[
  "!"
  "*"
  "|"
  "&"
  "||"
  "&&"
  "=="
  "!="
  "<"
  "<="
  ">"
  ">="
  "=~"
  "!~"
  "+"
  "-"
  "*"
  "/"
] @operator

(unary_expression "*" @operator.default)

(unary_expression "=~" @operator.regexp)

(unary_expression "!~" @operator.regexp)

(binary_expression _ "&" @operator.unify _)

(binary_expression _ "|" @operator.disjunct _)

(builtin) @function.builtin

(qualified_identifier) @function.builtin

(let_clause "let" @keyword.storage.type)

(for_clause "for" @keyword.control.repeat)
(for_clause "in" @keyword.control.repeat)

(guard_clause "if" @keyword.control.conditional)

(comment) @comment

[
  (string_type)
  (simple_string_lit)
  (multiline_string_lit)
  (bytes_type)
  (simple_bytes_lit)
  (multiline_bytes_lit)
] @string

[
  (number_type)
  (int_lit)
  (int_type)
  (uint_type)
] @constant.numeric.integer

[
  (float_lit)
  (float_type)
] @constant.numeric.float

[
  (bool_type)
  (true)
  (false)
] @constant.builtin.boolean

(null) @constant.builtin

(ellipsis) @punctuation.bracket

[
  ","
  ":"
] @punctuation.delimiter

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

(interpolation "\\(" @punctuation.bracket (_) ")" @punctuation.bracket) @variable.other.member

(field (label (identifier) @variable.other.member))

(
  (identifier) @keyword.storage.type
  (#match? @keyword.storage.type "^#")
)

(field (label alias: (identifier) @label))

(let_clause left: (identifier) @label)


(attribute (identifier) @tag)