-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathgleam.scm
More file actions
136 lines (116 loc) · 2.41 KB
/
gleam.scm
File metadata and controls
136 lines (116 loc) · 2.41 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
;; Statements
[
(let)
(constant)
(function)
(type_definition)
(function_call)
(case)
(todo)
] @statement
(constant
value: (_) @value
) @_.domain
(constant
name: (_) @name @type.leading.endOf
type: (_) @type
) @_.domain
(let
value: (_) @value
) @_.domain
(let
pattern: (_) @name
) @_.domain
(list) @list
(list_pattern) @list
(data_constructor
name: (_) @name
arguments: (data_constructor_arguments
[
;; if there is a key
(data_constructor_argument
label: (_) @argumentOrParameter @value.leading.endOf
value: (_) @value @argumentOrParameter.trailing.startOf
) @argumentOrParameter.domain
;; if there's no key
(data_constructor_argument
value: (_) @argumentOrParameter
)
]
) @type.iteration
) @type
(type_definition
(type_name) @name
) @type
(type) @type
(type_alias
(type_name) @name
(type) @value
) @type
(function
name: (_) @functionName @name
body: (function_body) @namedFunction.interior
) @namedFunction @functionName.domain
(anonymous_function
body: (_) @anonymousFunction.interior
) @anonymousFunction
(
(function_parameters
(_)? @argumentOrParameter.leading.endOf
.
(function_parameter) @argumentOrParameter
.
(_)? @argumentOrParameter.trailing.startOf
) @argumentOrParameter.iteration @_dummy
(#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n")
)
(function_parameter
name: (_) @type.leading.endOf @name
type: (_) @type
) @name.domain
(
(function_call
function: (_) @functionCallee
arguments: (arguments)
) @functionCall @functionCallee.domain
)
(
(arguments
(_)? @_.leading.endOf
.
(argument) @argumentOrParameter
.
(_)? @_.trailing.startOf
) @argumentOrParameter.iteration @_dummy
(#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n")
)
(case_clause
value: (_) @branch.interior
) @branch
(case_clause
patterns: (case_clause_patterns
(case_clause_pattern
(_) @condition
)
)
) @condition.domain
(
(case_clause
(case_clause_patterns
(_)? @condition.leading.endOf
.
(case_clause_pattern
(_) @condition
)
.
(_)? @condition.trailing.startOf
) @_dummy
) @condition.domain @condition.iteration
(#single-or-multi-line-delimiter! @condition @_dummy ", " ",\n")
)
(use
value: (_) @value
) @value.domain
(use
assignments: (use_assignments) @name
)