aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/gren/highlights.scm
blob: 030cf7fadb4f305b3b1d66c3461ab816a65490bd (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
111
112
113
114
115
116
117
118
119
120
121
; Keywords
[
  (as)
  (port)
  (exposing)
  (alias)
  (infix)
] @keyword

; Keywords - Conditionals
[
  "if"
  "then"
  "else"
  "let"
  "in"
  (when)
  (is)
] @keyword.conditional

; Keywords - Imports
[
  (import)
  (module)
] @keyword.import

; Operators
[
  (arrow)
  (backslash)
  (colon)
  (operator_identifier)
  (eq)
] @operator

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

[
  ","
  "|"
  (dot)
] @punctuation.delimiter

; Comments
[
  (block_comment)
  (line_comment)
] @comment

; Strings
[
  (close_quote)
  (open_quote)
  (regular_string_part)
] @string

; Strings - Escape
(string_escape) @string.escape

; Characters
[
  (open_char)
  (close_char)
] @character

(type_annotation
  (lower_case_identifier) @function)

(port_annotation
  (lower_case_identifier) @function)

(function_declaration_left
  (lower_case_identifier) @function)

(function_call_expr
  target: (value_expr) @function)

(field_access_expr
  (value_expr
    (value_qid) @variable.member))

(lower_pattern) @variable.parameter

(record_base_identifier) @variable

(number_constant_expr) @number

(type) @keyword.type

(type_declaration
  (upper_case_identifier) @type)

(type_ref) @type

(type_alias_declaration
  name: (upper_case_identifier) @type)

(union_variant
  (upper_case_identifier) @type)

(union_pattern
  constructor: (upper_case_qid
    (upper_case_identifier) @label
    (dot)
    (upper_case_identifier) @type))

(union_pattern
  constructor: (upper_case_qid
    (upper_case_identifier) @type))

(value_expr
  (upper_case_qid
    (upper_case_identifier)) @type)