aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/nickel/highlights.scm
blob: cd458df278a348741ce5d197d9f308108c564e74 (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
(types) @type
(type_builtin) @type.builtin
"Array" @type.builtin

(enum_tag) @constructor

"null" @constant.builtin
(bool) @constant.builtin.boolean
(str_esc_char) @constant.character.escape
(num_literal) @constant.numeric

(str_chunks) @string

; NOTE: Nickel has no block comments
(comment) @comment.line
; Nickel doesn't use comments for documentation, ideally this would be
; `@documentation` or something similar
(annot_atom
  doc: (static_string) @comment.block.documentation
)

(record_operand (atom (ident) @variable))
(let_expr
  "let" @keyword
  "rec"? @keyword
  pat: (pattern
    (ident) @variable
  )
  "in" @keyword
)
(fun_expr
  "fun" @keyword.function
  pats:
    (pattern
      id: (ident) @variable.parameter
    )+
  "=>" @operator
)
(record_field) @variable.other.member

[
  "."
] @punctuation.delimiter
[
  "{" "}"
  "(" ")"
  "[|" "|]"
  "[" "]"
] @punctuation.bracket
(multstr_start) @punctuation.bracket
(multstr_end) @punctuation.bracket
(interpolation_start) @punctuation.bracket
(interpolation_end) @punctuation.bracket

["forall" "default" "doc"] @keyword
["if" "then" "else" "switch"] @keyword.control.conditional
"import" @keyword.control.import

(infix_expr
  op: (_) @operator
)

(applicative
  t1: (applicative
    (record_operand) @function
  )
)
(builtin) @function.builtin