@@ -0,0 +1,179 @@
1+(comment) @comment
2+
3+; Identifiers
4+;------------
5+
6+; Escaped identifiers like \"+."
7+((value_identifier) @function.macro
8+ (#match? @function.macro "^\\.*$"))
9+
10+[
11+ (type_identifier)
12+ (unit_type)
13+ "list"
14+] @type
15+
16+[
17+ (variant_identifier)
18+ (polyvar_identifier)
19+] @constant
20+
21+(property_identifier) @variable.other.member
22+(module_identifier) @namespace
23+
24+(jsx_identifier) @tag
25+(jsx_attribute (property_identifier) @variable.parameter)
26+
27+; Parameters
28+;----------------
29+
30+(list_pattern (value_identifier) @variable.parameter)
31+(spread_pattern (value_identifier) @variable.parameter)
32+
33+; String literals
34+;----------------
35+
36+[
37+ (string)
38+ (template_string)
39+] @string
40+
41+(template_substitution
42+ "${" @punctuation.bracket
43+ "}" @punctuation.bracket) @embedded
44+
45+(character) @constant.character
46+(escape_sequence) @constant.character.escape
47+
48+; Other literals
49+;---------------
50+
51+[
52+ (true)
53+ (false)
54+] @constant.builtin
55+
56+(number) @constant.numeric
57+(polyvar) @constant
58+(polyvar_string) @constant
59+
60+; Functions
61+;----------
62+
63+[
64+ (formal_parameters (value_identifier))
65+ (positional_parameter (value_identifier))
66+ (labeled_parameter (value_identifier))
67+] @variable.parameter
68+
69+(function parameter: (value_identifier) @variable.parameter)
70+
71+; Meta
72+;-----
73+
74+[
75+ "@"
76+ "@@"
77+ (decorator_identifier)
78+] @label
79+
80+(extension_identifier) @keyword
81+("%") @keyword
82+
83+; Misc
84+;-----
85+
86+(subscript_expression index: (string) @variable.other.member)
87+(polyvar_type_pattern "#" @constant)
88+
89+[
90+ ("include")
91+ ("open")
92+] @keyword
93+
94+[
95+ "as"
96+ "export"
97+ "external"
98+ "let"
99+ "module"
100+ "mutable"
101+ "private"
102+ "rec"
103+ "type"
104+ "and"
105+] @keyword
106+
107+[
108+ "if"
109+ "else"
110+ "switch"
111+] @keyword
112+
113+[
114+ "exception"
115+ "try"
116+ "catch"
117+ "raise"
118+] @keyword
119+
120+[
121+ "."
122+ ","
123+ "|"
124+] @punctuation.delimiter
125+
126+[
127+ "++"
128+ "+"
129+ "+."
130+ "-"
131+ "-."
132+ "*"
133+ "*."
134+ "/"
135+ "/."
136+ "<"
137+ "<="
138+ "=="
139+ "==="
140+ "!"
141+ "!="
142+ "!=="
143+ ">"
144+ ">="
145+ "&&"
146+ "||"
147+ "="
148+ ":="
149+ "->"
150+ "|>"
151+ ":>"
152+ (uncurry)
153+] @operator
154+
155+[
156+ "("
157+ ")"
158+ "{"
159+ "}"
160+ "["
161+ "]"
162+] @punctuation.bracket
163+
164+(polyvar_type
165+ [
166+ "["
167+ "[>"
168+ "[<"
169+ "]"
170+ ] @punctuation.bracket)
171+
172+[
173+ "~"
174+ "?"
175+ "=>"
176+ "..."
177+] @punctuation
178+
179+(ternary_expression ["?" ":"] @operator)