aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/kdl/highlights.scm
blob: 72a8ca3953dafeaac03ef28dba0969c9e3861f12 (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
; Variables
(identifier) @variable

; Nodes
(node
  name: (identifier) @tag)

(node
  name: (identifier
    (string) @tag))

; Types
(type) @type

(type
  name: (identifier) @type)

; Reserved type annotations are advisory in the spec, not syntax.
((type
  name: (identifier) @type.builtin)
  (#any-of? @type.builtin
    "i8" "i16" "i32" "i64" "i128" "u8" "u16" "u32" "u64" "u128" "isize" "usize" "f32" "f64"
    "decimal64" "decimal128" "date-time" "time" "date" "duration" "decimal" "currency" "country-2"
    "country-3" "country-subdivision" "email" "idn-email" "hostname" "idn-hostname" "ipv4" "ipv6"
    "url" "url-reference" "irl" "irl-reference" "url-template" "uuid" "regex" "base64" "base85"))

; Properties
(prop
  key: (identifier) @property)

; Operators
"=" @operator

; Literals
(string) @string

(multi_line_string) @string

(string_fragment) @string

(escape) @string.escape

(escaped_whitespace) @string.escape

(number) @number

(keyword_number) @number

(number
  (decimal) @number.float)

(number
  (exponent) @number.float)

(boolean) @boolean

[
  "null"
  "#null"
] @constant.builtin

; Punctuation
[
  "{"
  "}"
] @punctuation.bracket

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

";" @punctuation.delimiter

; Comments
[
  (single_line_comment)
  (multi_line_comment)
  (version)
] @comment @spell

(node_comment) @comment

(node_field_comment) @comment

(node_children_comment) @comment