@@ -0,0 +1,101 @@
1+; Comments
2+(module_comment) @comment
3+(statement_comment) @comment
4+(comment) @comment
5+
6+; Constants
7+(constant
8+ name: (identifier) @constant)
9+
10+; Modules
11+(module) @namespace
12+(import alias: (identifier) @namespace)
13+(remote_type_identifier
14+ module: (identifier) @namespace)
15+((field_access
16+ record: (identifier) @namespace
17+ field: (label) @function)
18+ (#is-not? local))
19+
20+; Functions
21+(unqualified_import (identifier) @function)
22+(function
23+ name: (identifier) @function)
24+(external_function
25+ name: (identifier) @function)
26+(function_parameter
27+ name: (identifier) @variable.parameter)
28+((function_call
29+ function: (identifier) @function)
30+ (#is-not? local))
31+((binary_expression
32+ operator: "|>"
33+ right: (identifier) @function)
34+ (#is-not? local))
35+
36+; "Properties"
37+; Assumed to be intended to refer to a name for a field; something that comes
38+; before ":" or after "."
39+; e.g. record field names, tuple indices, names for named arguments, etc
40+(label) @variable.other.member
41+(tuple_access
42+ index: (integer) @variable.other.member)
43+
44+; Type names
45+(remote_type_identifier) @type
46+(type_identifier) @type
47+
48+; Literals
49+(string) @string
50+(bit_string_segment_option) @function.builtin
51+(integer) @constant.numeric.integer
52+(float) @constant.numeric.float
53+
54+; Variables
55+(identifier) @variable
56+(discard) @comment.unused
57+
58+; Operators
59+(binary_expression
60+ operator: _ @operator)
61+
62+; Keywords
63+[
64+ (visibility_modifier) ; "pub"
65+ (opacity_modifier) ; "opaque"
66+ "as"
67+ "assert"
68+ "case"
69+ "const"
70+ "external"
71+ "fn"
72+ "if"
73+ "import"
74+ "let"
75+ "todo"
76+ "try"
77+ "type"
78+] @keyword
79+
80+; Punctuation
81+[
82+ "("
83+ ")"
84+ "["
85+ "]"
86+ "{"
87+ "}"
88+ "<<"
89+ ">>"
90+] @punctuation.bracket
91+[
92+ "."
93+ ","
94+ ;; Controversial -- maybe some are operators?
95+ ":"
96+ "#"
97+ "="
98+ "->"
99+ ".."
100+ "-"
101+] @punctuation.delimiter