github-linguist 5.1.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,242 @@
1
+ {
2
+ "name": "KiCad PCB (S-expressions)",
3
+ "scopeName": "source.pcb.sexp",
4
+ "fileTypes": [
5
+ "kicad_mod",
6
+ "kicad_pcb",
7
+ "kicad_wks",
8
+ "fp-lib-table",
9
+ "dsn",
10
+ "net"
11
+ ],
12
+ "firstLineMatch": "^\\s*\\((?:kicad_pcb|fp_lib_table)\\s+",
13
+ "limitLineLength": false,
14
+ "patterns": [
15
+ {
16
+ "name": "meta.expression.layers.pcb.sexp",
17
+ "begin": "(\\()\\s*(layers)(?=\\s|$|\\()",
18
+ "end": "\\)",
19
+ "beginCaptures": {
20
+ "1": {
21
+ "name": "punctuation.section.expression.begin.pcb.sexp"
22
+ },
23
+ "2": {
24
+ "name": "storage.type.class.layers.pcb.sexp"
25
+ }
26
+ },
27
+ "endCaptures": {
28
+ "0": {
29
+ "name": "punctuation.section.expression.end.pcb.sexp"
30
+ }
31
+ },
32
+ "patterns": [
33
+ {
34
+ "name": "meta.expression.layer.pcb.sexp",
35
+ "begin": "(\\()\\s*(\\d+)(?:\\s+|(?=$|\\())",
36
+ "end": "\\)",
37
+ "beginCaptures": {
38
+ "1": {
39
+ "name": "punctuation.section.expression.begin.pcb.sexp"
40
+ },
41
+ "2": {
42
+ "name": "constant.numeric.integer.decimal.pcb.sexp"
43
+ }
44
+ },
45
+ "endCaptures": {
46
+ "0": {
47
+ "name": "punctuation.section.expression.end.pcb.sexp"
48
+ }
49
+ },
50
+ "patterns": [
51
+ {
52
+ "match": "\\G\\s*(-?(?:(?![\\s\\(\\)])[\\0-\\x7F])+)",
53
+ "captures": {
54
+ "1": {
55
+ "name": "entity.name.function.pcb.sexp"
56
+ }
57
+ }
58
+ },
59
+ {
60
+ "include": "#shared"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "include": "#shared"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "name": "meta.expression.comment.pcb.sexp",
71
+ "begin": "(\\()\\s*(comment)(?=\\s|$|\\()",
72
+ "end": "\\)",
73
+ "beginCaptures": {
74
+ "1": {
75
+ "name": "punctuation.section.expression.begin.pcb.sexp"
76
+ },
77
+ "2": {
78
+ "name": "entity.name.function.comment.pcb.sexp"
79
+ }
80
+ },
81
+ "endCaptures": {
82
+ "0": {
83
+ "name": "punctuation.section.expression.end.pcb.sexp"
84
+ }
85
+ },
86
+ "contentName": "comment.block.expression.pcb.sexp",
87
+ "patterns": [
88
+ {
89
+ "begin": "\"",
90
+ "end": "\"|^|$",
91
+ "patterns": [
92
+ {
93
+ "include": "#stringInnards"
94
+ }
95
+ ]
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "name": "meta.expression.pcb.sexp",
101
+ "begin": "\\(",
102
+ "end": "\\)",
103
+ "beginCaptures": {
104
+ "0": {
105
+ "name": "punctuation.section.expression.begin.pcb.sexp"
106
+ }
107
+ },
108
+ "endCaptures": {
109
+ "0": {
110
+ "name": "punctuation.section.expression.end.pcb.sexp"
111
+ }
112
+ },
113
+ "patterns": [
114
+ {
115
+ "match": "\\G\\s*(kicad_pcb|module|page_layout|fp_lib_table)(?=\\s|$|\\()",
116
+ "captures": {
117
+ "1": {
118
+ "name": "storage.type.class.pcb.sexp"
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "match": "\\G\\s*(string_quote)\\s+(\")(?=\\))",
124
+ "captures": {
125
+ "1": {
126
+ "name": "entity.name.function.pcb.sexp"
127
+ },
128
+ "2": {
129
+ "name": "constant.character.quote.pcb.sexp"
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "match": "\\G\\s*(-?(?:(?![\\s\\(\\)])[\\0-\\x7F])+)",
135
+ "captures": {
136
+ "1": {
137
+ "name": "entity.name.function.pcb.sexp"
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "include": "#shared"
143
+ }
144
+ ]
145
+ }
146
+ ],
147
+ "repository": {
148
+ "shared": {
149
+ "patterns": [
150
+ {
151
+ "include": "#values"
152
+ },
153
+ {
154
+ "include": "$self"
155
+ }
156
+ ]
157
+ },
158
+ "values": {
159
+ "patterns": [
160
+ {
161
+ "name": "constant.numeric.float.decimal.pcb.sexp",
162
+ "match": "[-+]?\\d*\\.\\d+"
163
+ },
164
+ {
165
+ "name": "constant.numeric.integer.decimal.pcb.sexp",
166
+ "match": "[-+]?\\d+(?=\\s|\\))"
167
+ },
168
+ {
169
+ "name": "constant.numeric.integer.hex.pcb.sexp",
170
+ "match": "0x[A-Fa-f0-9]+(?:_[A-Fa-f0-9]+)*"
171
+ },
172
+ {
173
+ "name": "constant.language.boolean.$1.pcb.sexp",
174
+ "match": "(?<=\\s|\\(|\\))(true|false|yes|no)(?=\\s|\\(|\\))"
175
+ },
176
+ {
177
+ "name": "string.quoted.double.empty.pcb.sexp",
178
+ "match": "(\")(\")",
179
+ "captures": {
180
+ "1": {
181
+ "name": "punctuation.definition.string.begin.pcb.sexp"
182
+ },
183
+ "2": {
184
+ "name": "punctuation.definition.string.end.pcb.sexp"
185
+ }
186
+ }
187
+ },
188
+ {
189
+ "name": "string.quoted.double.pcb.sexp",
190
+ "begin": "\"",
191
+ "end": "\"|^|$",
192
+ "beginCaptures": {
193
+ "0": {
194
+ "name": "punctuation.definition.string.begin.pcb.sexp"
195
+ }
196
+ },
197
+ "endCaptures": {
198
+ "0": {
199
+ "name": "punctuation.definition.string.end.pcb.sexp"
200
+ }
201
+ },
202
+ "patterns": [
203
+ {
204
+ "include": "#stringInnards"
205
+ }
206
+ ]
207
+ },
208
+ {
209
+ "name": "meta.embedded.source.pcb.sexp",
210
+ "match": "(\\${)([^\\s}\\(\\)]+)(})",
211
+ "captures": {
212
+ "1": {
213
+ "name": "punctuation.section.embedded.bracket.curly.begin.pcb.sexp"
214
+ },
215
+ "2": {
216
+ "name": "string.interpolated.embedded.pcb.sexp"
217
+ },
218
+ "3": {
219
+ "name": "punctuation.section.embedded.bracket.curly.end.pcb.sexp"
220
+ }
221
+ }
222
+ },
223
+ {
224
+ "name": "variable.parameter.identifier.pcb.sexp",
225
+ "match": "[^\\s\\(\\)]+"
226
+ }
227
+ ]
228
+ },
229
+ "stringInnards": {
230
+ "patterns": [
231
+ {
232
+ "name": "constant.character.escape.pcb.sexp",
233
+ "match": "\\\\\\S"
234
+ },
235
+ {
236
+ "name": "invalid.illegal.unclosed.string.pcb.sexp",
237
+ "match": "\\G(?:[^\"\\\\]|\\\\.)+(?=$)"
238
+ }
239
+ ]
240
+ }
241
+ }
242
+ }
@@ -1665,7 +1665,7 @@
1665
1665
  },
1666
1666
  "magic-variable-names": {
1667
1667
  "comment": "magic variables which a class/module may have.",
1668
- "match": "(?x)\n \\b(\n __(?:\n all | bases | builtins | class | code | debug | defaults | dict\n | doc | file | func | kwdefaults | members\n | metaclass | methods | module | mro | name\n | qualname | self | signature | slots | subclasses\n | version | weakref | wrapped | annotations | classcell\n | spec | path | package | future\n )__\n )\\b\n",
1668
+ "match": "(?x)\n \\b(\n __(?:\n all | bases | builtins | class | code | debug | defaults | dict\n | doc | file | func | kwdefaults | members\n | metaclass | methods | module | mro | name\n | qualname | self | signature | slots | subclasses\n | version | weakref | wrapped | annotations | classcell\n | spec | path | package | future | traceback\n )__\n )\\b\n",
1669
1669
  "captures": {
1670
1670
  "1": {
1671
1671
  "name": "support.variable.magic.python"
@@ -0,0 +1,14 @@
1
+ {
2
+ "scopeName": "source.reason.hover.type",
3
+ "patterns": [
4
+ {
5
+ "include": "source.reason#signature-expression"
6
+ },
7
+ {
8
+ "include": "source.reason#module-item-type"
9
+ },
10
+ {
11
+ "include": "source.reason#type-expression"
12
+ }
13
+ ]
14
+ }
@@ -1,296 +1,3375 @@
1
1
  {
2
+ "name": "Reason",
3
+ "scopeName": "source.reason",
2
4
  "fileTypes": [
3
5
  "re",
4
6
  "rei"
5
7
  ],
6
- "foldingStartMarker": "^.*\\bfun\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$",
7
- "foldingStopMarker": "^\\s*\\}",
8
- "name": "Reason",
9
8
  "patterns": [
10
9
  {
11
- "include": "#reason_comment_doc_block"
10
+ "include": "#structure-expression-block-item"
12
11
  },
13
12
  {
14
- "include": "#reason_comment_block"
13
+ "include": "#value-expression"
14
+ }
15
+ ],
16
+ "repository": {
17
+ "attribute": {
18
+ "begin": "(?=\\[(@{1,3})[[:space:]]*[[:alpha:]])",
19
+ "end": "\\]",
20
+ "patterns": [
21
+ {
22
+ "begin": "\\[(@{1,3})",
23
+ "end": "(?=[^_\\.'[:word:]])",
24
+ "beginCaptures": {
25
+ "1": {
26
+ "name": "keyword.control.less"
27
+ }
28
+ },
29
+ "patterns": [
30
+ {
31
+ "include": "#attribute-identifier"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "include": "#attribute-payload"
37
+ }
38
+ ]
15
39
  },
16
- {
17
- "include": "#reason_named_arg"
40
+ "attribute-identifier": {
41
+ "patterns": [
42
+ {
43
+ "match": "\\b([[:alpha:]][[:word:]]*)\\b[[:space:]]*(?:(\\.))",
44
+ "captures": {
45
+ "1": {
46
+ "name": "support.class entity.name.class"
47
+ },
48
+ "2": {
49
+ "name": "keyword.control.less"
50
+ }
51
+ }
52
+ },
53
+ {
54
+ "match": "\\b([[:alpha:]][[:word:]]*)\\b",
55
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
56
+ }
57
+ ]
18
58
  },
19
- {
20
- "include": "#reason_module"
59
+ "attribute-payload": {
60
+ "patterns": [
61
+ {
62
+ "begin": "(:)",
63
+ "end": "(?=\\])",
64
+ "beginCaptures": {
65
+ "1": {
66
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
67
+ }
68
+ },
69
+ "patterns": [
70
+ {
71
+ "include": "#structure-expression"
72
+ },
73
+ {
74
+ "include": "#module-item-type"
75
+ },
76
+ {
77
+ "include": "#type-expression"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "begin": "([\\?])",
83
+ "end": "(?=\\])",
84
+ "beginCaptures": {
85
+ "1": {
86
+ "name": "keyword.control.less"
87
+ }
88
+ },
89
+ "patterns": [
90
+ {
91
+ "include": "#pattern-guard"
92
+ },
93
+ {
94
+ "include": "#pattern"
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "include": "#structure-expression-block-item"
100
+ },
101
+ {
102
+ "include": "#value-expression"
103
+ }
104
+ ]
21
105
  },
22
- {
23
- "include": "#reason_lifetime"
106
+ "class-item-inherit": {
107
+ "begin": "\\b(inherit)\\b",
108
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
109
+ "beginCaptures": {
110
+ "1": {
111
+ "name": "keyword.other"
112
+ }
113
+ },
114
+ "endCaptures": {
115
+ "1": {
116
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
117
+ }
118
+ },
119
+ "patterns": [
120
+ {
121
+ "include": "#value-expression"
122
+ }
123
+ ]
24
124
  },
25
- {
26
- "include": "#reason_self"
125
+ "class-item-method": {
126
+ "begin": "\\b(method)\\b",
127
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|type|val|with)\\b)",
128
+ "beginCaptures": {
129
+ "1": {
130
+ "name": "storage.type"
131
+ }
132
+ },
133
+ "endCaptures": {
134
+ "1": {
135
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
136
+ }
137
+ },
138
+ "patterns": [
139
+ {
140
+ "include": "#module-item-let-value-bind-name-params-type-body"
141
+ }
142
+ ]
27
143
  },
28
- {
29
- "include": "#reason_string"
144
+ "comment": {
145
+ "name": "comment",
146
+ "patterns": [
147
+ {
148
+ "include": "#comment-block-doc"
149
+ },
150
+ {
151
+ "include": "#comment-block"
152
+ }
153
+ ]
30
154
  },
31
- {
32
- "include": "#reason_raw_string"
155
+ "comment-block": {
156
+ "begin": "/\\*",
157
+ "end": "\\*/",
158
+ "name": "comment.block",
159
+ "patterns": [
160
+ {
161
+ "include": "#comment"
162
+ }
163
+ ]
33
164
  },
34
- {
35
- "match": "\\'([^\\'\\\\]|\\\\(x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]{1,6}\\}|.))\\'",
36
- "name": "string.quoted.single.source.reason"
165
+ "comment-block-doc": {
166
+ "begin": "/\\*\\*(?!/)",
167
+ "end": "\\*/",
168
+ "name": "comment.block.documentation",
169
+ "patterns": [
170
+ {
171
+ "include": "#comment"
172
+ }
173
+ ]
37
174
  },
38
- {
39
- "captures": {
175
+ "condition-lhs": {
176
+ "begin": "(?<![#\\-:!?.@*/&%^+<=>|~$\\\\])([\\?])(?![#\\-:!?.@*/&%^+<=>|~$\\\\])",
177
+ "end": "(?=[\\)])",
178
+ "beginCaptures": {
40
179
  "1": {
41
- "name": "keyword.source.reason"
42
- },
43
- "2": {
44
- "name": "entity.name.function.source.reason"
180
+ "name": "keyword.control message.error variable.interpolation"
45
181
  }
46
182
  },
47
- "match": "\\b(fun)\\s+([a-zA-Z_][a-zA-Z0-9_]?[\\w\\:,+ \\'<>?]*)\\s*(?:\\()",
48
- "name": "meta.function.source.reason"
49
- },
50
- {
51
- "captures": {
52
- "1": {
53
- "name": "keyword.source.reason"
54
- },
55
- "2": {
56
- "name": "keyword.source.reason"
183
+ "patterns": [
184
+ {
185
+ "match": "(?:\\b|[[:space:]]+)([?])(?:\\b|[[:space:]]+)",
186
+ "name": "keyword.control message.error variable.interpolation"
57
187
  },
58
- "3": {
59
- "name": "keyword.source.reason"
188
+ {
189
+ "include": "#value-expression"
190
+ }
191
+ ]
192
+ },
193
+ "extension-node": {
194
+ "begin": "(?=\\[(%{1,3})[[:space:]]*[[:alpha:]])",
195
+ "end": "\\]",
196
+ "patterns": [
197
+ {
198
+ "begin": "\\[(%{1,3})",
199
+ "end": "(?=[^_\\.'[:word:]])",
200
+ "beginCaptures": {
201
+ "1": {
202
+ "name": "keyword.control.less"
203
+ }
204
+ },
205
+ "patterns": [
206
+ {
207
+ "include": "#attribute-identifier"
208
+ }
209
+ ]
60
210
  },
61
- "4": {
62
- "name": "variable.other.reason"
211
+ {
212
+ "include": "#attribute-payload"
213
+ }
214
+ ]
215
+ },
216
+ "jsx": {
217
+ "patterns": [
218
+ {
219
+ "include": "#jsx-head"
63
220
  },
64
- "5": {
65
- "name": "storage.type.source.reason"
221
+ {
222
+ "include": "#jsx-tail"
223
+ }
224
+ ]
225
+ },
226
+ "jsx-attributes": {
227
+ "patterns": [
228
+ {
229
+ "begin": "\\b([[:lower:]][[:word:]]*)\\b[[:space:]]*(=)",
230
+ "end": "(?<![=])(?=[/>[:lower:]])",
231
+ "comment": "meta.separator",
232
+ "beginCaptures": {
233
+ "1": {
234
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
235
+ },
236
+ "2": {
237
+ "name": "keyword.control.less"
238
+ }
239
+ },
240
+ "patterns": [
241
+ {
242
+ "include": "#value-expression-atomic-with-paths"
243
+ }
244
+ ]
66
245
  },
67
- "6": {
68
- "name": "keyword.operator.reason"
246
+ {
247
+ "match": "(\\b([[:lower:]][[:word:]]*)\\b[[:space:]]*+)",
248
+ "captures": {
249
+ "1": {
250
+ "comment": "meta.separator"
251
+ },
252
+ "2": {
253
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
254
+ }
255
+ }
69
256
  }
70
- },
71
- "comment": "This matches the 'let x = val' style of variable intitialization.",
72
- "match": "(let|and)\\s+(module\\s+)(rec\\s+)?([[:alpha:]_][[:alnum:]_]*)\\s*(:[^=]*)?(=?)",
73
- "name": "meta.initialization.reason"
257
+ ]
74
258
  },
75
- {
76
- "captures": {
259
+ "jsx-body": {
260
+ "begin": "((>))",
261
+ "end": "(?=</)",
262
+ "beginCaptures": {
77
263
  "1": {
78
- "name": "keyword.source.reason"
264
+ "comment": "meta.separator"
79
265
  },
80
266
  "2": {
81
- "name": "keyword.source.reason"
267
+ "name": "punctuation.definition.tag.end.js"
268
+ }
269
+ },
270
+ "patterns": [
271
+ {
272
+ "comment": "FIXME: seems necessary in order to properly tokenize `[[:word:]]</` boundary",
273
+ "match": "[[:lower:]][[:word:]]*"
82
274
  },
83
- "4": {
84
- "name": "storage.type.source.reason"
275
+ {
276
+ "include": "#value-expression"
277
+ }
278
+ ]
279
+ },
280
+ "jsx-head": {
281
+ "begin": "((<))(?=[_[:alpha:]])",
282
+ "end": "((/>))|(?=</)",
283
+ "applyEndPatternLast": true,
284
+ "beginCaptures": {
285
+ "1": {
286
+ "comment": "meta.separator"
85
287
  },
86
- "5": {
87
- "name": "keyword.operator.reason"
288
+ "2": {
289
+ "name": "punctuation.definition.tag.begin.js"
88
290
  }
89
291
  },
90
- "comment": "This matches the 'let x = val' style of variable intitialization.",
91
- "match": "(let)\\s+(rec\\s+)?([[:alpha:]_][[:alnum:]_]*)\\s*(:[^=]*)?(=?)",
92
- "name": "meta.initialization.reason"
93
- },
94
- {
95
- "captures": {
292
+ "endCaptures": {
96
293
  "1": {
97
- "name": "keyword.source.reason"
294
+ "comment": "meta.separator"
98
295
  },
99
296
  "2": {
100
- "name": "support"
297
+ "name": "punctuation.definition.tag.end.js"
101
298
  }
102
299
  },
103
- "match": "(extern\\s+crate)\\s+(\\w+)",
104
- "name": "meta.import.reason"
300
+ "patterns": [
301
+ {
302
+ "begin": "\\G",
303
+ "end": "(?=[[:space:]/>])[[:space:]]*+",
304
+ "comment": "meta.separator",
305
+ "patterns": [
306
+ {
307
+ "include": "#module-path-simple"
308
+ },
309
+ {
310
+ "match": "\\b[[:lower:]][[:word:]]*\\b",
311
+ "name": "entity.name.tag.inline.any.html"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "include": "#jsx-attributes"
317
+ },
318
+ {
319
+ "include": "#jsx-body"
320
+ }
321
+ ]
105
322
  },
106
- {
107
- "captures": {
323
+ "jsx-tail": {
324
+ "begin": "\\G(/>)|(</)",
325
+ "end": "(>)",
326
+ "applyEndPatternLast": true,
327
+ "comment": "meta.separator",
328
+ "beginCaptures": {
108
329
  "1": {
109
- "name": "keyword.source.reason"
330
+ "name": "punctuation.definition.tag.end.js"
110
331
  },
111
332
  "2": {
112
- "name": "entity.name.macro.source.reason"
333
+ "name": "punctuation.definition.tag.begin.js"
334
+ }
335
+ },
336
+ "endCaptures": {
337
+ "1": {
338
+ "name": "punctuation.definition.tag.end.js"
113
339
  }
114
340
  },
115
- "match": "\\b(macro_rules!)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?:\\{)",
116
- "name": "meta.macro.source.reason"
117
- },
118
- {
119
- "match": "\\b(as|box|break|claim|const|continue|copy|Copy|crate|do|drop|then|else|extern|for|if|impl|in|let|and|loop|switch|fun|open|include|mod|move|mutable|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|exception|type|module|rec|where)\\b",
120
- "name": "keyword.source.reason"
121
- },
122
- {
123
- "match": "\\b(Self|m32|m64|m128|f80|f16|f128|int|uint|isize|usize|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|Option|Either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b",
124
- "name": "storage.type.source.reason"
125
- },
126
- {
127
- "match": "\\bself\\b",
128
- "name": "variable.language.source.reason"
129
- },
130
- {
131
- "match": "\\b(true|false|Some|None|Ok|Err)\\b",
132
- "name": "constant.language.source.reason"
133
- },
134
- {
135
- "match": "\\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b",
136
- "name": "support.constant.source.reason"
137
- },
138
- {
139
- "begin": "#!?\\[",
140
- "end": "\\]",
141
- "name": "comment.block.attribute.reason",
142
341
  "patterns": [
143
342
  {
144
- "include": "#reason_string"
343
+ "include": "#module-path-simple"
145
344
  },
146
345
  {
147
- "include": "#reason_raw_string"
346
+ "match": "\\b[[:lower:]][[:word:]]*\\b",
347
+ "name": "entity.name.tag.inline.any.html"
148
348
  }
149
349
  ]
150
350
  },
151
- {
152
- "match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(usize|u8|u16|u32|u64))|([0-9][0-9_]*(isize|i8|i16|i32|i64)))\\b",
153
- "name": "constant.numeric.integer.source.reason"
154
- },
155
- {
156
- "match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(usize|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(isize|i8|i16|i32|i64)))\\b",
157
- "name": "constant.numeric.hex.source.reason"
158
- },
159
- {
160
- "match": "\\b((0b[01_]+)|(0b[01_]+(usize|u8|u16|u32|u64))|(0b[01_]+(isize|i8|i16|i32|i64)))\\b",
161
- "name": "constant.numeric.binary.source.reason"
162
- },
163
- {
164
- "match": "\\b(([0-9][0-9_]*(f32|f64|f))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+)|([0-9][0-9_]*\\.[0-9_]+(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+)(f32|f64|f)))\\b",
165
- "name": "constant.numeric.float.source.reason"
166
- },
167
- {
168
- "match": "(=>)|(->)|[-:=*,!.+|%/&~@<>;]",
169
- "name": "keyword.operator.reason"
170
- },
171
- {
172
- "match": "\\b_\\b",
173
- "name": "support.function.reason"
174
- },
175
- {
176
- "match": "\\b(\\w+)\\b(?=\\()",
177
- "name": "support.function.reason"
351
+ "module-name-extended": {
352
+ "patterns": [
353
+ {
354
+ "include": "#module-name-simple"
355
+ },
356
+ {
357
+ "begin": "([\\(])",
358
+ "end": "([\\)])",
359
+ "captures": {
360
+ "1": {
361
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
362
+ }
363
+ },
364
+ "patterns": [
365
+ {
366
+ "include": "#module-path-extended"
367
+ }
368
+ ]
369
+ }
370
+ ]
178
371
  },
179
- {
180
- "match": "\\b(\\w+!)(?=\\()",
181
- "name": "support.macro.reason"
372
+ "module-name-simple": {
373
+ "match": "\\b[[:upper:]][[:word:]]*\\b",
374
+ "name": "support.class entity.name.class"
182
375
  },
183
- {
184
- "match": "\\b(\\w+)::",
185
- "name": "meta.namespace-block.reason"
376
+ "module-path-extended": {
377
+ "patterns": [
378
+ {
379
+ "include": "#module-name-extended"
380
+ },
381
+ {
382
+ "include": "#comment"
383
+ },
384
+ {
385
+ "comment": "NOTE: end early to avoid too much reparsing",
386
+ "begin": "([\\.])",
387
+ "end": "(?<=[[:word:]\\)])|(?=[^\\.[:upper:]/])",
388
+ "beginCaptures": {
389
+ "1": {
390
+ "name": "keyword.control.less"
391
+ }
392
+ },
393
+ "patterns": [
394
+ {
395
+ "begin": "(?<=[\\.])",
396
+ "end": "(?<=[[:word:]\\)])|(?=[^\\.[:upper:]/])",
397
+ "patterns": [
398
+ {
399
+ "include": "#comment"
400
+ },
401
+ {
402
+ "include": "#module-name-extended"
403
+ }
404
+ ]
405
+ }
406
+ ]
407
+ }
408
+ ]
186
409
  },
187
- {
188
- "captures": {
410
+ "module-path-extended-prefix": {
411
+ "begin": "(?=\\b[[:upper:]])",
412
+ "end": "([\\.])|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
413
+ "endCaptures": {
189
414
  "1": {
190
- "name": "meta.preprocessor.reason"
415
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
191
416
  }
192
417
  },
193
- "match": "\\b(\\w+!)\\s*[({\\[]",
194
- "name": "meta.macro.source.reason"
195
- },
196
- {
197
- "match": "(\\[|\\]|{|}|\\(|\\))",
198
- "name": "punctuation.definition.bracket.reason"
199
- },
200
- {
201
- "match": "\\b(Box|Vec|StrBuf|Path|Option|Result|Reader|Writer|Stream|Seek|Buffer|IoError|IoResult|Sender|SyncSender|Receiver|Cell|RefCell|Any)\\b",
202
- "name": "support.class.std.source.reason"
203
- },
204
- {
205
- "match": "\\b(Send|Sized|Copy|Share)\\b",
206
- "name": "support.type.kind.source.reason"
207
- },
208
- {
209
- "match": "\\bbox\\b",
210
- "name": "storage.modifier.box.source.reason"
211
- },
212
- {
213
- "match": "\\brec\\b",
214
- "name": "storage.modifier.rec.source.reason"
215
- },
216
- {
217
- "match": "\\bmodule\\b",
218
- "name": "storage.modifier.module.source.reason"
219
- }
220
- ],
221
- "repository": {
222
- "reason_comment_block": {
223
- "begin": "/\\*",
224
- "end": "\\*/",
225
- "name": "comment.block.source.reason",
226
418
  "patterns": [
227
419
  {
228
- "include": "#reason_comment_block"
420
+ "include": "#module-path-extended"
229
421
  }
230
422
  ]
231
423
  },
232
- "reason_comment_doc_block": {
233
- "begin": "/\\*[!\\*][^\\*]",
234
- "end": "\\*/",
235
- "name": "comment.block.documentation.source.reason",
424
+ "module-path-simple": {
236
425
  "patterns": [
237
426
  {
238
- "include": "#reason_comment_doc_block"
427
+ "include": "#module-name-simple"
428
+ },
429
+ {
430
+ "include": "#comment"
431
+ },
432
+ {
433
+ "comment": "NOTE: end early to avoid too much reparsing",
434
+ "begin": "([\\.])",
435
+ "end": "(?<=[[:word:]\\)])|(?=[^\\.[:upper:]/])",
436
+ "beginCaptures": {
437
+ "1": {
438
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
439
+ }
440
+ },
441
+ "patterns": [
442
+ {
443
+ "begin": "(?<=[\\.])",
444
+ "end": "(?<=[[:word:]\\)])|(?=[^\\.[:upper:]/])",
445
+ "patterns": [
446
+ {
447
+ "include": "#comment"
448
+ },
449
+ {
450
+ "include": "#module-name-simple"
451
+ }
452
+ ]
453
+ }
454
+ ]
239
455
  }
240
456
  ]
241
457
  },
242
- "reason_escaped_character": {
243
- "match": "\\\\(x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]{1,6}\\}|.)",
244
- "name": "constant.character.escape.source.reason"
245
- },
246
- "reason_lifetime": {
247
- "captures": {
458
+ "module-path-simple-prefix": {
459
+ "begin": "(?=\\b[[:upper:]])",
460
+ "end": "([\\.])|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
461
+ "endCaptures": {
248
462
  "1": {
249
- "name": "entity.name.lifetime.source.reason"
463
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
250
464
  }
251
465
  },
252
- "match": "\\'([a-zA-Z_][a-zA-Z0-9_]*)(?!\\')\\b",
253
- "name": "storage.modifier.lifetime.source.reason"
466
+ "patterns": [
467
+ {
468
+ "include": "#module-path-simple"
469
+ }
470
+ ]
254
471
  },
255
- "reason_module": {
256
- "captures": {
472
+ "module-item-class-type": {
473
+ "comment": "FIXME: proper parsing",
474
+ "begin": "\\b(class)\\b",
475
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|module|nonrec|open|private|rec|type|val|with)\\b)",
476
+ "beginCaptures": {
257
477
  "1": {
258
- "name": "variable.other.reason"
478
+ "name": "keyword.other"
259
479
  }
260
480
  },
261
- "match": "\\b([A-Z][a-zA-Z0-9_]*)\\b"
262
- },
263
- "reason_named_arg": {
264
- "captures": {
481
+ "endCaptures": {
265
482
  "1": {
266
- "name": "storage.modifier.lifetime.source.reason"
267
- },
268
- "2": {
269
- "name": "entity.name.lifetime.source.reason"
483
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
270
484
  }
271
485
  },
272
- "match": "(@([a-zA-Z_][a-zA-Z0-9_]*))\\b"
486
+ "patterns": [
487
+ {
488
+ "begin": "(?:\\G|^)[[:space:]]*\\b(type)\\b",
489
+ "end": "(?==)",
490
+ "beginCaptures": {
491
+ "1": {
492
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
493
+ }
494
+ },
495
+ "patterns": [
496
+ {
497
+ "include": "#module-item-type-bind-name-tyvars"
498
+ }
499
+ ]
500
+ },
501
+ {
502
+ "begin": "(=)",
503
+ "end": "(?=;)",
504
+ "beginCaptures": {
505
+ "1": {
506
+ "name": "keyword.control.less"
507
+ }
508
+ },
509
+ "patterns": [
510
+ {
511
+ "include": "#attribute"
512
+ },
513
+ {
514
+ "include": "#comment"
515
+ },
516
+ {
517
+ "include": "#class-item-inherit"
518
+ },
519
+ {
520
+ "include": "#class-item-method"
521
+ }
522
+ ]
523
+ }
524
+ ]
273
525
  },
274
- "reason_raw_string": {
275
- "begin": "r(#*)\"",
276
- "end": "\"(\\1)",
277
- "name": "string.quoted.double.raw.source.reason"
526
+ "module-item-exception": {
527
+ "begin": "\\b(exception)\\b",
528
+ "end": "(;)|(?=}|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
529
+ "beginCaptures": {
530
+ "1": {
531
+ "name": "keyword.other"
532
+ }
533
+ },
534
+ "endCaptures": {
535
+ "1": {
536
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
537
+ }
538
+ },
539
+ "patterns": [
540
+ {
541
+ "include": "#module-item-type-bind-body-item"
542
+ }
543
+ ]
278
544
  },
279
- "reason_self": {
280
- "match": "\\bself\\b",
281
- "name": "variable.language.source.reason"
545
+ "module-item-external": {
546
+ "begin": "\\b(external)\\b",
547
+ "end": "(;)|(?=}|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
548
+ "beginCaptures": {
549
+ "1": {
550
+ "name": "storage.type"
551
+ }
552
+ },
553
+ "endCaptures": {
554
+ "1": {
555
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
556
+ }
557
+ },
558
+ "patterns": [
559
+ {
560
+ "include": "#module-item-let-value-bind-name-or-pattern"
561
+ },
562
+ {
563
+ "include": "#module-item-let-value-bind-type"
564
+ },
565
+ {
566
+ "begin": "(=)",
567
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
568
+ "beginCaptures": {
569
+ "1": {
570
+ "name": "keyword.control.less"
571
+ }
572
+ },
573
+ "patterns": [
574
+ {
575
+ "include": "#attribute"
576
+ },
577
+ {
578
+ "begin": "\"",
579
+ "end": "\"",
580
+ "name": "string.double string.regexp",
581
+ "patterns": [
582
+ {
583
+ "include": "#value-literal-string-escape"
584
+ },
585
+ {
586
+ "match": "(?:(%)(.*?)|(caml.*?))(?=\"|(?:[^\\\\\\n]$))",
587
+ "captures": {
588
+ "1": {
589
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
590
+ },
591
+ "2": {
592
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
593
+ },
594
+ "3": {
595
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
596
+ }
597
+ }
598
+ }
599
+ ]
600
+ }
601
+ ]
602
+ }
603
+ ]
282
604
  },
283
- "reason_string": {
284
- "begin": "\"",
285
- "end": "\"",
286
- "name": "string.quoted.double.source.reason",
605
+ "module-item-include": {
606
+ "begin": "\\b(include)\\b",
607
+ "end": "(;)|(?=}|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val)\\b)",
608
+ "beginCaptures": {
609
+ "1": {
610
+ "name": "keyword.control.include"
611
+ }
612
+ },
613
+ "endCaptures": {
614
+ "1": {
615
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
616
+ }
617
+ },
287
618
  "patterns": [
288
619
  {
289
- "include": "#reason_escaped_character"
620
+ "include": "#signature-expression"
290
621
  }
291
622
  ]
292
- }
293
- },
294
- "scopeName": "source.reason",
295
- "uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d"
623
+ },
624
+ "module-item-let": {
625
+ "begin": "\\b(let)\\b",
626
+ "end": "(;)|(?=}|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
627
+ "beginCaptures": {
628
+ "1": {
629
+ "name": "storage.type"
630
+ }
631
+ },
632
+ "endCaptures": {
633
+ "1": {
634
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
635
+ }
636
+ },
637
+ "patterns": [
638
+ {
639
+ "include": "#module-item-let-module"
640
+ },
641
+ {
642
+ "include": "#module-item-let-value"
643
+ }
644
+ ]
645
+ },
646
+ "module-item-let-module": {
647
+ "begin": "(?:\\G|^)[[:space:]]*\\b(module)\\b",
648
+ "end": "(?=[;}]|\\b(class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|type|val|with)\\b)",
649
+ "beginCaptures": {
650
+ "1": {
651
+ "name": "variable.other.class.js variable.interpolation keyword.control storage.type message.error"
652
+ }
653
+ },
654
+ "patterns": [
655
+ {
656
+ "include": "#comment"
657
+ },
658
+ {
659
+ "include": "#module-item-let-module-and"
660
+ },
661
+ {
662
+ "include": "#module-item-let-module-rec"
663
+ },
664
+ {
665
+ "include": "#module-item-let-module-bind-name-params-type-body"
666
+ }
667
+ ]
668
+ },
669
+ "module-item-let-module-and": {
670
+ "begin": "\\b(and)\\b",
671
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
672
+ "beginCaptures": {
673
+ "1": {
674
+ "name": "storage.type"
675
+ }
676
+ },
677
+ "patterns": [
678
+ {
679
+ "include": "#module-item-let-module-bind-name-params-type-body"
680
+ }
681
+ ]
682
+ },
683
+ "module-item-let-module-bind-body": {
684
+ "begin": "(=>?)",
685
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
686
+ "beginCaptures": {
687
+ "1": {
688
+ "name": "keyword.control.less"
689
+ }
690
+ },
691
+ "patterns": [
692
+ {
693
+ "include": "#structure-expression"
694
+ }
695
+ ]
696
+ },
697
+ "module-item-let-module-bind-name-params": {
698
+ "begin": "\\b([[:upper:]][[:word:]]*)\\b",
699
+ "end": "(?=[;:}=]|\\b(class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
700
+ "beginCaptures": {
701
+ "1": {
702
+ "name": "support.class entity.name.class"
703
+ }
704
+ },
705
+ "patterns": [
706
+ {
707
+ "include": "#comment"
708
+ },
709
+ {
710
+ "include": "#module-item-let-module-param"
711
+ }
712
+ ]
713
+ },
714
+ "module-item-let-module-bind-name-params-type-body": {
715
+ "begin": "(?:\\G|^)",
716
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
717
+ "patterns": [
718
+ {
719
+ "include": "#comment"
720
+ },
721
+ {
722
+ "include": "#module-item-let-module-bind-name-params"
723
+ },
724
+ {
725
+ "include": "#module-item-let-module-bind-type"
726
+ },
727
+ {
728
+ "include": "#module-item-let-module-bind-body"
729
+ }
730
+ ]
731
+ },
732
+ "module-item-let-module-bind-type": {
733
+ "begin": "(:)",
734
+ "end": "(?=[;}=]|\\b(and|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val)\\b)",
735
+ "beginCaptures": {
736
+ "1": {
737
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
738
+ }
739
+ },
740
+ "patterns": [
741
+ {
742
+ "include": "#signature-expression"
743
+ }
744
+ ]
745
+ },
746
+ "module-item-let-module-param": {
747
+ "begin": "(?=\\()",
748
+ "end": "\\)",
749
+ "patterns": [
750
+ {
751
+ "begin": "\\(",
752
+ "end": "(?=[:])",
753
+ "patterns": [
754
+ {
755
+ "include": "#comment"
756
+ },
757
+ {
758
+ "include": "#module-name-simple"
759
+ }
760
+ ]
761
+ },
762
+ {
763
+ "begin": "(:)",
764
+ "end": "(?=\\))",
765
+ "beginCaptures": {
766
+ "1": {
767
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
768
+ }
769
+ },
770
+ "patterns": [
771
+ {
772
+ "include": "#signature-expression"
773
+ }
774
+ ]
775
+ }
776
+ ]
777
+ },
778
+ "module-item-let-module-rec": {
779
+ "begin": "(?:\\G|^)[[:space:]]*\\b(rec)\\b",
780
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
781
+ "beginCaptures": {
782
+ "1": {
783
+ "name": "keyword.control storage.modifier.rec"
784
+ }
785
+ },
786
+ "patterns": [
787
+ {
788
+ "include": "#module-item-let-module-bind-name-params-type-body"
789
+ }
790
+ ]
791
+ },
792
+ "module-item-let-value": {
793
+ "patterns": [
794
+ {
795
+ "include": "#module-item-let-value-and"
796
+ },
797
+ {
798
+ "include": "#module-item-let-value-rec"
799
+ },
800
+ {
801
+ "include": "#module-item-let-value-bind-name-params-type-body"
802
+ }
803
+ ]
804
+ },
805
+ "module-item-let-value-and": {
806
+ "begin": "\\b(and)\\b",
807
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
808
+ "beginCaptures": {
809
+ "1": {
810
+ "name": "storage.type"
811
+ }
812
+ },
813
+ "patterns": [
814
+ {
815
+ "include": "#module-item-let-value-bind-name-params-type-body"
816
+ }
817
+ ]
818
+ },
819
+ "module-item-let-value-bind-body": {
820
+ "begin": "(=>?)",
821
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
822
+ "beginCaptures": {
823
+ "1": {
824
+ "name": "keyword.control.less"
825
+ }
826
+ },
827
+ "patterns": [
828
+ {
829
+ "include": "#value-expression"
830
+ }
831
+ ]
832
+ },
833
+ "module-item-let-value-bind-name-or-pattern": {
834
+ "begin": "(?<=[^[:word:]]and|^and|[^[:word:]]external|^external|[^[:word:]]let|^let|[^[:word:]]method|^method|[^[:word:]]rec|^rec)[[:space:]]*",
835
+ "end": "(?<=[^[:space:]])|(?=[[:space:]]|[;:}=]|\\b(and|as|class|constraint|exception|external|for|include|inherit|let|method|module|nonrec|open|private|rec|switch|try|type|val|while|with)\\b)",
836
+ "patterns": [
837
+ {
838
+ "include": "#comment"
839
+ },
840
+ {
841
+ "match": "\\b(?:([_][[:word:]]+)|([[:lower:]][[:word:]]*))\\b",
842
+ "captures": {
843
+ "1": {
844
+ "name": "comment"
845
+ },
846
+ "2": {
847
+ "name": "entity.name.function"
848
+ }
849
+ }
850
+ },
851
+ {
852
+ "include": "#module-item-let-value-bind-parens-params"
853
+ },
854
+ {
855
+ "include": "#pattern"
856
+ }
857
+ ]
858
+ },
859
+ "module-item-let-value-bind-name-params-type-body": {
860
+ "begin": "(?<=[^[:word:]]and|^and|[^[:word:]]external|^external|[^[:word:]]let|^let|[^[:word:]]method|^method|[^[:word:]]rec|^rec)",
861
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
862
+ "patterns": [
863
+ {
864
+ "include": "#module-item-let-value-bind-name-or-pattern"
865
+ },
866
+ {
867
+ "include": "#module-item-let-value-bind-params-type"
868
+ },
869
+ {
870
+ "include": "#module-item-let-value-bind-type"
871
+ },
872
+ {
873
+ "include": "#module-item-let-value-bind-body"
874
+ }
875
+ ]
876
+ },
877
+ "module-item-let-value-bind-params-type": {
878
+ "begin": "(?=[^[:space:]:=])",
879
+ "end": "(?=[;}=]|\\b(class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
880
+ "patterns": [
881
+ {
882
+ "include": "#comment"
883
+ },
884
+ {
885
+ "include": "#module-item-let-value-param"
886
+ },
887
+ {
888
+ "begin": "(:)[[:space:]]*(?![[:space:]]*[\\)])",
889
+ "end": "(?=[;}=]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|val|with)\\b)",
890
+ "beginCaptures": {
891
+ "1": {
892
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
893
+ }
894
+ },
895
+ "patterns": [
896
+ {
897
+ "include": "#type-expression-atomic"
898
+ }
899
+ ]
900
+ }
901
+ ]
902
+ },
903
+ "module-item-let-value-bind-parens-params": {
904
+ "begin": "\\((?![\\)])",
905
+ "end": "\\)",
906
+ "patterns": [
907
+ {
908
+ "include": "#operator"
909
+ },
910
+ {
911
+ "include": "#pattern-parens-lhs"
912
+ },
913
+ {
914
+ "include": "#type-annotation-rhs"
915
+ },
916
+ {
917
+ "include": "#pattern"
918
+ }
919
+ ]
920
+ },
921
+ "module-item-let-value-bind-pattern": {
922
+ "begin": "(?<=[^[:word:]]and|^and|[^[:word:]]external|^external|[^[:word:]]let|^let|[^[:word:]]method|^method|[^[:word:]]rec|^rec)",
923
+ "end": "(?=[;:}=]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
924
+ "patterns": [
925
+ {
926
+ "include": "#comment"
927
+ },
928
+ {
929
+ "include": "#module-item-let-value-bind-parens-params"
930
+ },
931
+ {
932
+ "include": "#pattern"
933
+ }
934
+ ]
935
+ },
936
+ "module-item-let-value-bind-type": {
937
+ "comment": "FIXME: lookahead",
938
+ "begin": "(:)(?![[:space:]]*[\\)])",
939
+ "end": "(?==[^>]|[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|val|with)\\b)",
940
+ "beginCaptures": {
941
+ "1": {
942
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
943
+ }
944
+ },
945
+ "patterns": [
946
+ {
947
+ "begin": "\\b(type)\\b",
948
+ "end": "([\\.])",
949
+ "beginCaptures": {
950
+ "1": {
951
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
952
+ }
953
+ },
954
+ "endCaptures": {
955
+ "1": {
956
+ "name": "entity.name.function"
957
+ }
958
+ },
959
+ "patterns": [
960
+ {
961
+ "include": "#pattern-variable"
962
+ }
963
+ ]
964
+ },
965
+ {
966
+ "include": "#type-expression"
967
+ }
968
+ ]
969
+ },
970
+ "module-item-let-value-param": {
971
+ "patterns": [
972
+ {
973
+ "include": "#module-item-let-value-param-label"
974
+ },
975
+ {
976
+ "include": "#module-item-let-value-param-type"
977
+ },
978
+ {
979
+ "include": "#module-item-let-value-param-module"
980
+ },
981
+ {
982
+ "include": "#pattern"
983
+ }
984
+ ]
985
+ },
986
+ "module-item-let-value-param-label": {
987
+ "patterns": [
988
+ {
989
+ "begin": "\\b([[:lower:]][[:word:]]*)\\b[[:space:]]*(::)",
990
+ "end": "(?<=[[:space:]])",
991
+ "beginCaptures": {
992
+ "1": {
993
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
994
+ },
995
+ "2": {
996
+ "name": "keyword.control"
997
+ }
998
+ },
999
+ "patterns": [
1000
+ {
1001
+ "include": "#pattern"
1002
+ },
1003
+ {
1004
+ "begin": "(=)",
1005
+ "end": "(\\?)|(?<=[^[:space:]=][[:space:]])(?=[[:space:]]*+[^\\.])",
1006
+ "beginCaptures": {
1007
+ "1": {
1008
+ "name": "markup.inserted keyword.control.less message.error"
1009
+ }
1010
+ },
1011
+ "endCaptures": {
1012
+ "1": {
1013
+ "name": "storage.type"
1014
+ }
1015
+ },
1016
+ "patterns": [
1017
+ {
1018
+ "include": "#value-expression-atomic-with-paths"
1019
+ }
1020
+ ]
1021
+ }
1022
+ ]
1023
+ }
1024
+ ]
1025
+ },
1026
+ "module-item-let-value-param-module": {
1027
+ "comment": "FIXME: merge with pattern-parens",
1028
+ "begin": "\\([[:space:]]*(?=\\b(module)\\b)",
1029
+ "end": "\\)",
1030
+ "patterns": [
1031
+ {
1032
+ "begin": "\\b(module)\\b",
1033
+ "end": "(?=\\))",
1034
+ "beginCaptures": {
1035
+ "1": {
1036
+ "name": "keyword.other message.error"
1037
+ }
1038
+ },
1039
+ "patterns": [
1040
+ {
1041
+ "match": "\\b[[:upper:]][[:word:]]*\\b",
1042
+ "name": "support.class entity.name.class"
1043
+ }
1044
+ ]
1045
+ }
1046
+ ]
1047
+ },
1048
+ "module-item-let-value-param-type": {
1049
+ "comment": "FIXME: merge with pattern-parens",
1050
+ "begin": "\\((?=\\b(type)\\b)",
1051
+ "end": "\\)",
1052
+ "patterns": [
1053
+ {
1054
+ "begin": "\\b(type)\\b",
1055
+ "end": "(?=\\))",
1056
+ "beginCaptures": {
1057
+ "1": {
1058
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1059
+ }
1060
+ },
1061
+ "patterns": [
1062
+ {
1063
+ "include": "#pattern-variable"
1064
+ }
1065
+ ]
1066
+ }
1067
+ ]
1068
+ },
1069
+ "module-item-let-value-rec": {
1070
+ "begin": "(?:\\G|^)[[:space:]]*\\b(rec)\\b",
1071
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1072
+ "beginCaptures": {
1073
+ "1": {
1074
+ "name": "keyword.control storage.modifier message.error"
1075
+ }
1076
+ },
1077
+ "patterns": [
1078
+ {
1079
+ "include": "#module-item-let-value-bind-name-params-type-body"
1080
+ }
1081
+ ]
1082
+ },
1083
+ "module-item-module": {
1084
+ "comment": "NOTE: this is to support the let-module case without the let prefix",
1085
+ "begin": "\\b(module)\\b[[:space:]]*(?!\\b(type)\\b|$)",
1086
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1087
+ "beginCaptures": {
1088
+ "1": {
1089
+ "name": "storage.type message.error"
1090
+ }
1091
+ },
1092
+ "endCaptures": {
1093
+ "1": {
1094
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1095
+ }
1096
+ },
1097
+ "patterns": [
1098
+ {
1099
+ "include": "#module-item-let-module-and"
1100
+ },
1101
+ {
1102
+ "include": "#module-item-let-module-rec"
1103
+ },
1104
+ {
1105
+ "include": "#module-item-let-module-bind-name-params-type-body"
1106
+ }
1107
+ ]
1108
+ },
1109
+ "module-item-module-type": {
1110
+ "begin": "\\b(module)\\b[[:space:]]*(?=\\b(type)\\b|$)",
1111
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|val|with)\\b)",
1112
+ "beginCaptures": {
1113
+ "1": {
1114
+ "name": "keyword.control message.error"
1115
+ }
1116
+ },
1117
+ "endCaptures": {
1118
+ "1": {
1119
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1120
+ }
1121
+ },
1122
+ "patterns": [
1123
+ {
1124
+ "begin": "(?:\\G|^)[[:space:]]*\\b(type)\\b",
1125
+ "end": "(?==)",
1126
+ "beginCaptures": {
1127
+ "1": {
1128
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1129
+ }
1130
+ },
1131
+ "patterns": [
1132
+ {
1133
+ "include": "#comment"
1134
+ },
1135
+ {
1136
+ "match": "([[:upper:]][[:word:]]*)",
1137
+ "captures": {
1138
+ "1": {
1139
+ "name": "support.class entity.name.class"
1140
+ }
1141
+ }
1142
+ }
1143
+ ]
1144
+ },
1145
+ {
1146
+ "begin": "(=)",
1147
+ "end": "(?=;)",
1148
+ "beginCaptures": {
1149
+ "1": {
1150
+ "name": "keyword.control.less"
1151
+ }
1152
+ },
1153
+ "patterns": [
1154
+ {
1155
+ "include": "#comment"
1156
+ },
1157
+ {
1158
+ "include": "#signature-expression"
1159
+ }
1160
+ ]
1161
+ }
1162
+ ]
1163
+ },
1164
+ "module-item-open": {
1165
+ "begin": "\\b(open)\\b",
1166
+ "end": "(;)|(?=}|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1167
+ "beginCaptures": {
1168
+ "1": {
1169
+ "name": "keyword.control.open"
1170
+ }
1171
+ },
1172
+ "endCaptures": {
1173
+ "1": {
1174
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1175
+ }
1176
+ },
1177
+ "patterns": [
1178
+ {
1179
+ "include": "#comment"
1180
+ },
1181
+ {
1182
+ "include": "#module-path-simple"
1183
+ }
1184
+ ]
1185
+ },
1186
+ "module-item-type": {
1187
+ "comment": "FIXME: the semi-colon is optional so we can re-use this for hover, which does not print the trailing ;",
1188
+ "begin": "\\b(type)\\b",
1189
+ "end": "(;)|(?=[\\)}]|\\b(class|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
1190
+ "beginCaptures": {
1191
+ "1": {
1192
+ "name": "keyword.other"
1193
+ }
1194
+ },
1195
+ "endCaptures": {
1196
+ "1": {
1197
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1198
+ }
1199
+ },
1200
+ "patterns": [
1201
+ {
1202
+ "include": "#module-item-type-and"
1203
+ },
1204
+ {
1205
+ "include": "#module-item-type-constraint"
1206
+ },
1207
+ {
1208
+ "include": "#module-item-type-bind"
1209
+ }
1210
+ ]
1211
+ },
1212
+ "module-item-type-and": {
1213
+ "comment": "FIXME: the optional `type` is for module constraints",
1214
+ "begin": "\\b(and)\\b([[:space:]]*type)?",
1215
+ "end": "(?=[;\\)}]|\\b(class|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
1216
+ "beginCaptures": {
1217
+ "1": {
1218
+ "name": "keyword.other"
1219
+ },
1220
+ "2": {
1221
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1222
+ }
1223
+ },
1224
+ "patterns": [
1225
+ {
1226
+ "include": "#module-item-type-bind-name-tyvars-body"
1227
+ }
1228
+ ]
1229
+ },
1230
+ "module-item-type-bind": {
1231
+ "comment": "FIXME: only allow module paths before type variables",
1232
+ "patterns": [
1233
+ {
1234
+ "include": "#module-item-type-bind-nonrec"
1235
+ },
1236
+ {
1237
+ "include": "#module-item-type-bind-name-tyvars-body"
1238
+ }
1239
+ ]
1240
+ },
1241
+ "module-item-type-bind-body": {
1242
+ "comment": "FIXME: parsing",
1243
+ "begin": "(\\+?=)",
1244
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|rec|type|val|with)\\b)",
1245
+ "beginCaptures": {
1246
+ "1": {
1247
+ "name": "keyword.control.less"
1248
+ }
1249
+ },
1250
+ "patterns": [
1251
+ {
1252
+ "include": "#module-item-type-bind-body-item"
1253
+ }
1254
+ ]
1255
+ },
1256
+ "module-item-type-bind-body-item": {
1257
+ "patterns": [
1258
+ {
1259
+ "match": "(=)(?!>)|\\b(private)\\b",
1260
+ "captures": {
1261
+ "1": {
1262
+ "name": "keyword.control.less"
1263
+ },
1264
+ "2": {
1265
+ "name": "variable.other.class.js variable.interpolation storage.modifier message.error"
1266
+ }
1267
+ }
1268
+ },
1269
+ {
1270
+ "comment": "FIXME: specialized version of variant rule that also scans for (",
1271
+ "match": "\\b([[:upper:]][[:word:]]*)\\b(?![[:space:]]*[\\.\\(])",
1272
+ "captures": {
1273
+ "1": {
1274
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1275
+ }
1276
+ }
1277
+ },
1278
+ {
1279
+ "begin": "(\\.\\.)",
1280
+ "end": "(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1281
+ "beginCaptures": {
1282
+ "1": {
1283
+ "name": "keyword.control.less"
1284
+ }
1285
+ }
1286
+ },
1287
+ {
1288
+ "begin": "(\\|)(?![#\\-:!?.@*/&%^+<=>|~$\\\\])[[:space:]]*",
1289
+ "end": "(?=[;\\)}]|\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\])|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1290
+ "beginCaptures": {
1291
+ "1": {
1292
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1293
+ }
1294
+ },
1295
+ "patterns": [
1296
+ {
1297
+ "include": "#value-expression-constructor"
1298
+ },
1299
+ {
1300
+ "match": "([:])|\\b(of)\\b",
1301
+ "captures": {
1302
+ "1": {
1303
+ "name": "keyword.control.less"
1304
+ },
1305
+ "2": {
1306
+ "name": "keyword.other"
1307
+ }
1308
+ }
1309
+ },
1310
+ {
1311
+ "include": "#type-expression"
1312
+ }
1313
+ ]
1314
+ },
1315
+ {
1316
+ "comment": "FIXME: remove this once the pretty printer no longer outputs 'of'",
1317
+ "match": "(:)|(\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))|\\b(of)\\b",
1318
+ "captures": {
1319
+ "1": {
1320
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1321
+ },
1322
+ "2": {
1323
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1324
+ },
1325
+ "3": {
1326
+ "name": "keyword.other"
1327
+ }
1328
+ }
1329
+ },
1330
+ {
1331
+ "include": "#type-expression"
1332
+ }
1333
+ ]
1334
+ },
1335
+ "module-item-type-bind-name-tyvars": {
1336
+ "begin": "(?<=\\G|^|\\.)[[:space:]]*\\b([[:lower:]][[:word:]]*)\\b",
1337
+ "end": "(?=\\+?=|[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1338
+ "beginCaptures": {
1339
+ "1": {
1340
+ "name": "entity.name.function"
1341
+ }
1342
+ },
1343
+ "patterns": [
1344
+ {
1345
+ "include": "#comment"
1346
+ },
1347
+ {
1348
+ "include": "#attribute"
1349
+ },
1350
+ {
1351
+ "match": "_",
1352
+ "name": "comment"
1353
+ },
1354
+ {
1355
+ "comment": "FIXME: add separate type-variable rule",
1356
+ "match": "([+\\-])?(?:(_)|(')([[:lower:]][[:word:]]*)\\b)(?!\\.[[:upper:]])",
1357
+ "captures": {
1358
+ "1": {
1359
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1360
+ },
1361
+ "2": {
1362
+ "name": "comment"
1363
+ },
1364
+ "3": {
1365
+ "name": "comment"
1366
+ },
1367
+ "4": {
1368
+ "name": "variable.parameter string.other.link variable.language"
1369
+ }
1370
+ }
1371
+ }
1372
+ ]
1373
+ },
1374
+ "module-item-type-bind-name-tyvars-body": {
1375
+ "begin": "(?=(\\G|^)[[:space:]]*\\b[[:alpha:]])",
1376
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1377
+ "patterns": [
1378
+ {
1379
+ "include": "#module-path-simple-prefix"
1380
+ },
1381
+ {
1382
+ "include": "#module-item-type-bind-name-tyvars"
1383
+ },
1384
+ {
1385
+ "include": "#module-item-type-bind-body"
1386
+ }
1387
+ ]
1388
+ },
1389
+ "module-item-type-bind-nonrec": {
1390
+ "begin": "(?:\\G|^)[[:space:]]*\\b(nonrec)\\b",
1391
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1392
+ "beginCaptures": {
1393
+ "1": {
1394
+ "name": "keyword.control storage.modifier message.error"
1395
+ }
1396
+ },
1397
+ "patterns": [
1398
+ {
1399
+ "include": "#module-item-type-bind-name-tyvars-body"
1400
+ }
1401
+ ]
1402
+ },
1403
+ "module-item-type-constraint": {
1404
+ "comment": "FIXME: proper parsing",
1405
+ "begin": "\\b(constraint)\\b",
1406
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1407
+ "beginCaptures": {
1408
+ "1": {
1409
+ "name": "variable.other.class.js variable.interpolation storage.modifier message.error"
1410
+ }
1411
+ },
1412
+ "patterns": [
1413
+ {
1414
+ "comment": "FIXME: add separate type-variable rule",
1415
+ "match": "([+\\-])?(')([_[:lower:]][[:word:]]*)\\b(?!\\.[[:upper:]])",
1416
+ "captures": {
1417
+ "1": {
1418
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1419
+ },
1420
+ "2": {
1421
+ "name": "comment"
1422
+ },
1423
+ "3": {
1424
+ "name": "variable.parameter string.other.link variable.language"
1425
+ }
1426
+ }
1427
+ },
1428
+ {
1429
+ "match": "=",
1430
+ "name": "keyword.control.less"
1431
+ },
1432
+ {
1433
+ "include": "#type-expression"
1434
+ }
1435
+ ]
1436
+ },
1437
+ "object-item": {
1438
+ "begin": "\\G|(;)",
1439
+ "end": "(?=[;}]|\\b(class|constraint|exception|external|include|let|module|nonrec|open|private|type|val|with)\\b)",
1440
+ "beginCaptures": {
1441
+ "1": {
1442
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1443
+ }
1444
+ },
1445
+ "patterns": [
1446
+ {
1447
+ "include": "#class-item-method"
1448
+ }
1449
+ ]
1450
+ },
1451
+ "operator": {
1452
+ "patterns": [
1453
+ {
1454
+ "include": "#operator-infix"
1455
+ },
1456
+ {
1457
+ "include": "#operator-prefix"
1458
+ }
1459
+ ]
1460
+ },
1461
+ "operator-infix": {
1462
+ "patterns": [
1463
+ {
1464
+ "match": ";",
1465
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1466
+ },
1467
+ {
1468
+ "include": "#operator-infix-assign"
1469
+ },
1470
+ {
1471
+ "include": "#operator-infix-builtin"
1472
+ },
1473
+ {
1474
+ "include": "#operator-infix-custom"
1475
+ },
1476
+ {
1477
+ "comment": "#operator-infix-custom-hash"
1478
+ }
1479
+ ]
1480
+ },
1481
+ "operator-infix-assign": {
1482
+ "match": "(?<![#\\-:!?.@*/&%^+<=>|~$\\\\])(=)(?![#\\-:!?.@*/&%^+<=>|~$\\\\])",
1483
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control.less message.error"
1484
+ },
1485
+ "operator-infix-builtin": {
1486
+ "match": ":=",
1487
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control.less message.error"
1488
+ },
1489
+ "operator-infix-custom": {
1490
+ "match": "(?:(?<![#\\-:!?.@*/&%^+<=>|~$\\\\])((<>))(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))|([#\\-@*/&%^+<=>$\\\\][#\\-:!?.@*/&%^+<=>|~$\\\\]*|[|][#\\-:!?.@*/&%^+<=>|~$\\\\]+)",
1491
+ "captures": {
1492
+ "1": {
1493
+ "comment": "meta.separator"
1494
+ },
1495
+ "2": {
1496
+ "name": "punctuation.definition.tag.begin.js"
1497
+ },
1498
+ "3": {
1499
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1500
+ }
1501
+ }
1502
+ },
1503
+ "operator-infix-custom-hash": {
1504
+ "match": "#[\\-:!?.@*/&%^+<=>|~$]+",
1505
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1506
+ },
1507
+ "operator-prefix": {
1508
+ "patterns": [
1509
+ {
1510
+ "include": "#operator-prefix-bang"
1511
+ },
1512
+ {
1513
+ "include": "#operator-prefix-label-token"
1514
+ }
1515
+ ]
1516
+ },
1517
+ "operator-prefix-bang": {
1518
+ "match": "![\\-:!?.@*/&%^+<=>|~$]*",
1519
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1520
+ },
1521
+ "operator-prefix-label-token": {
1522
+ "match": "[?~][\\-:!?.@*/&%^+<=>|~$]+",
1523
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1524
+ },
1525
+ "pattern": {
1526
+ "patterns": [
1527
+ {
1528
+ "include": "#attribute"
1529
+ },
1530
+ {
1531
+ "include": "#comment"
1532
+ },
1533
+ {
1534
+ "include": "#pattern-atomic"
1535
+ },
1536
+ {
1537
+ "match": "[[:space:]]*+(?:(\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))|\\b(as)\\b|(\\.\\.\\.?))[[:space:]]*+",
1538
+ "captures": {
1539
+ "1": {
1540
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1541
+ },
1542
+ "2": {
1543
+ "name": "keyword.other"
1544
+ },
1545
+ "3": {
1546
+ "name": "keyword.control"
1547
+ }
1548
+ }
1549
+ }
1550
+ ]
1551
+ },
1552
+ "pattern-atomic": {
1553
+ "patterns": [
1554
+ {
1555
+ "match": "\\b(exception)\\b",
1556
+ "name": "keyword.other"
1557
+ },
1558
+ {
1559
+ "include": "#value-expression-literal"
1560
+ },
1561
+ {
1562
+ "include": "#module-path-simple-prefix"
1563
+ },
1564
+ {
1565
+ "include": "#pattern-list-or-array"
1566
+ },
1567
+ {
1568
+ "include": "#pattern-record"
1569
+ },
1570
+ {
1571
+ "include": "#pattern-variable"
1572
+ },
1573
+ {
1574
+ "include": "#pattern-parens"
1575
+ }
1576
+ ]
1577
+ },
1578
+ "pattern-guard": {
1579
+ "begin": "\\b(when)\\b",
1580
+ "end": "(?==>)",
1581
+ "beginCaptures": {
1582
+ "1": {
1583
+ "name": "keyword.other"
1584
+ }
1585
+ },
1586
+ "patterns": [
1587
+ {
1588
+ "include": "#value-expression"
1589
+ }
1590
+ ]
1591
+ },
1592
+ "pattern-list-or-array": {
1593
+ "begin": "(\\[\\|?)(?![@%])",
1594
+ "end": "(\\|?\\])",
1595
+ "beginCaptures": {
1596
+ "1": {
1597
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1598
+ }
1599
+ },
1600
+ "endCaptures": {
1601
+ "1": {
1602
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1603
+ }
1604
+ },
1605
+ "patterns": [
1606
+ {
1607
+ "include": "#value-expression-literal-list-or-array-separator"
1608
+ },
1609
+ {
1610
+ "include": "#pattern"
1611
+ }
1612
+ ]
1613
+ },
1614
+ "pattern-parens": {
1615
+ "begin": "(?=\\()",
1616
+ "end": "\\)|(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1617
+ "patterns": [
1618
+ {
1619
+ "include": "#pattern-parens-lhs"
1620
+ },
1621
+ {
1622
+ "include": "#type-annotation-rhs"
1623
+ }
1624
+ ]
1625
+ },
1626
+ "pattern-parens-lhs": {
1627
+ "begin": "\\(|(,)",
1628
+ "end": "(?=(?:[,:\\)]))|(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1629
+ "beginCaptures": {
1630
+ "1": {
1631
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1632
+ }
1633
+ },
1634
+ "patterns": [
1635
+ {
1636
+ "include": "#pattern"
1637
+ }
1638
+ ]
1639
+ },
1640
+ "record-path": {
1641
+ "begin": "\\b[[:lower:]][[:word:]]*\\b",
1642
+ "end": "(?=[^[:space:]\\.])(?!/\\*)",
1643
+ "patterns": [
1644
+ {
1645
+ "include": "#comment"
1646
+ },
1647
+ {
1648
+ "include": "#record-path-suffix"
1649
+ }
1650
+ ]
1651
+ },
1652
+ "record-path-suffix": {
1653
+ "begin": "(\\.)",
1654
+ "end": "(\\))|\\b([[:upper:]][[:word:]]*)\\b|\\b([[:lower:]][[:word:]]*)\\b|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|with)\\b)",
1655
+ "beginCaptures": {
1656
+ "1": {
1657
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1658
+ }
1659
+ },
1660
+ "endCaptures": {
1661
+ "1": {
1662
+ "name": "keyword.control"
1663
+ },
1664
+ "2": {
1665
+ "name": "support.class entity.name.class"
1666
+ },
1667
+ "3": {
1668
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
1669
+ }
1670
+ },
1671
+ "patterns": [
1672
+ {
1673
+ "include": "#comment"
1674
+ },
1675
+ {
1676
+ "begin": "([\\(])",
1677
+ "end": "(?=[\\)])",
1678
+ "beginCaptures": {
1679
+ "1": {
1680
+ "name": "keyword.control"
1681
+ }
1682
+ },
1683
+ "patterns": [
1684
+ {
1685
+ "include": "#comment"
1686
+ },
1687
+ {
1688
+ "match": "\\b([[:lower:]][[:word:]]*)\\b(?=[^\\)]*([\\.]))",
1689
+ "captures": {
1690
+ "1": {
1691
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
1692
+ },
1693
+ "2": {
1694
+ "name": "keyword.other"
1695
+ }
1696
+ }
1697
+ },
1698
+ {
1699
+ "match": "([\\.])",
1700
+ "name": "keyword.control.less"
1701
+ },
1702
+ {
1703
+ "match": "\\b([[:lower:]][[:word:]]*)\\b[[:space:]]*",
1704
+ "captures": {
1705
+ "1": {
1706
+ "name": "variable.parameter string.other.link variable.language"
1707
+ }
1708
+ }
1709
+ },
1710
+ {
1711
+ "include": "#value-expression"
1712
+ }
1713
+ ]
1714
+ }
1715
+ ]
1716
+ },
1717
+ "pattern-record": {
1718
+ "begin": "{",
1719
+ "end": "}",
1720
+ "patterns": [
1721
+ {
1722
+ "include": "#comment"
1723
+ },
1724
+ {
1725
+ "include": "#pattern-record-item"
1726
+ }
1727
+ ]
1728
+ },
1729
+ "pattern-record-field": {
1730
+ "begin": "\\b([_][[:word:]]*)\\b|\\b([[:lower:]][[:word:]]*)\\b",
1731
+ "end": "(,)|(?=})",
1732
+ "beginCaptures": {
1733
+ "1": {
1734
+ "name": "comment"
1735
+ },
1736
+ "2": {
1737
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
1738
+ }
1739
+ },
1740
+ "endCaptures": {
1741
+ "1": {
1742
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1743
+ }
1744
+ },
1745
+ "patterns": [
1746
+ {
1747
+ "include": "#comment"
1748
+ },
1749
+ {
1750
+ "begin": "\\G(:)",
1751
+ "end": "(?=[,}])",
1752
+ "beginCaptures": {
1753
+ "1": {
1754
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1755
+ }
1756
+ },
1757
+ "patterns": [
1758
+ {
1759
+ "include": "#pattern"
1760
+ }
1761
+ ]
1762
+ }
1763
+ ]
1764
+ },
1765
+ "pattern-record-item": {
1766
+ "patterns": [
1767
+ {
1768
+ "include": "#module-path-simple-prefix"
1769
+ },
1770
+ {
1771
+ "include": "#pattern-record-field"
1772
+ }
1773
+ ]
1774
+ },
1775
+ "pattern-variable": {
1776
+ "patterns": [
1777
+ {
1778
+ "match": "\\b(_(?:[[:lower:]][[:word:]]*)?)\\b(?!\\.[[:upper:]])",
1779
+ "captures": {
1780
+ "1": {
1781
+ "name": "comment"
1782
+ }
1783
+ }
1784
+ },
1785
+ {
1786
+ "match": "\\b([[:lower:]][[:word:]]*)\\b(?!\\.[[:upper:]])",
1787
+ "captures": {
1788
+ "1": {
1789
+ "name": "variable.language string.other.link"
1790
+ }
1791
+ }
1792
+ }
1793
+ ]
1794
+ },
1795
+ "signature-expression": {
1796
+ "patterns": [
1797
+ {
1798
+ "comment": "FIXME: scan for :upper: to disambiguate type/signature in hover",
1799
+ "begin": "(?=\\([[:space:]]*[[:upper:]][[:word:]]*[[:space:]]*:)",
1800
+ "end": "(?=[;])",
1801
+ "patterns": [
1802
+ {
1803
+ "begin": "(?=\\()",
1804
+ "end": "(?=[;]|=>)",
1805
+ "patterns": [
1806
+ {
1807
+ "include": "#module-item-let-module-param"
1808
+ }
1809
+ ]
1810
+ },
1811
+ {
1812
+ "begin": "(=>)",
1813
+ "end": "(?=[;\\(])",
1814
+ "beginCaptures": {
1815
+ "1": {
1816
+ "name": "markup.inserted keyword.control.less"
1817
+ }
1818
+ },
1819
+ "patterns": [
1820
+ {
1821
+ "include": "#structure-expression"
1822
+ }
1823
+ ]
1824
+ }
1825
+ ]
1826
+ },
1827
+ {
1828
+ "begin": "\\b(module)\\b[[:space:]]*\\b(type)\\b([[:space:]]*\\b(of)\\b)?",
1829
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1830
+ "beginCaptures": {
1831
+ "1": {
1832
+ "name": "markup.inserted keyword.other variable.other.readwrite.instance"
1833
+ },
1834
+ "2": {
1835
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1836
+ },
1837
+ "3": {
1838
+ "name": "markup.inserted keyword.other variable.other.readwrite.instance"
1839
+ }
1840
+ },
1841
+ "patterns": [
1842
+ {
1843
+ "include": "#comment"
1844
+ },
1845
+ {
1846
+ "include": "#module-path-simple"
1847
+ },
1848
+ {
1849
+ "match": "\\b([[:upper:]][[:word:]]*)\\b",
1850
+ "name": "support.class entity.name.class"
1851
+ }
1852
+ ]
1853
+ },
1854
+ {
1855
+ "include": "#signature-expression-constraints"
1856
+ },
1857
+ {
1858
+ "include": "#structure-expression"
1859
+ }
1860
+ ]
1861
+ },
1862
+ "signature-expression-constraints": {
1863
+ "begin": "(?=\\b(with))",
1864
+ "end": "(?=[;\\)}]|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|val)\\b)",
1865
+ "patterns": [
1866
+ {
1867
+ "begin": "\\b(and|with)\\b",
1868
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|val|with)\\b)",
1869
+ "beginCaptures": {
1870
+ "1": {
1871
+ "name": "variable.other.class.js variable.interpolation storage.modifier message.error"
1872
+ }
1873
+ },
1874
+ "patterns": [
1875
+ {
1876
+ "include": "#comment"
1877
+ },
1878
+ {
1879
+ "comment": "FIXME: special version of #module-item-type with non-consuming `;`. Atom seems to need this to work.",
1880
+ "begin": "\\b(type)\\b",
1881
+ "end": "(?=[;\\)}]|\\b(class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|val|with)\\b)",
1882
+ "beginCaptures": {
1883
+ "1": {
1884
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
1885
+ }
1886
+ },
1887
+ "patterns": [
1888
+ {
1889
+ "include": "#module-item-type-and"
1890
+ },
1891
+ {
1892
+ "include": "#module-item-type-constraint"
1893
+ },
1894
+ {
1895
+ "include": "#module-item-type-bind"
1896
+ }
1897
+ ]
1898
+ },
1899
+ {
1900
+ "begin": "(?=\\b(module)\\b)",
1901
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|val|with)\\b)",
1902
+ "patterns": [
1903
+ {
1904
+ "begin": "\\b(module)\\b",
1905
+ "end": "(?=:?=|[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
1906
+ "beginCaptures": {
1907
+ "1": {
1908
+ "name": "markup.inserted keyword.control storage.type variable.other.readwrite.instance"
1909
+ }
1910
+ },
1911
+ "patterns": [
1912
+ {
1913
+ "include": "#comment"
1914
+ },
1915
+ {
1916
+ "include": "#module-path-simple"
1917
+ },
1918
+ {
1919
+ "match": "[[:upper:]][[:word:]]*",
1920
+ "name": "support.class entity.name.class"
1921
+ }
1922
+ ]
1923
+ },
1924
+ {
1925
+ "begin": "(:=)|(=)",
1926
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|type|val|with)\\b)",
1927
+ "beginCaptures": {
1928
+ "1": {
1929
+ "name": "markup.inserted keyword.control.less message.error"
1930
+ },
1931
+ "2": {
1932
+ "name": "markup.inserted keyword.control.less"
1933
+ }
1934
+ },
1935
+ "patterns": [
1936
+ {
1937
+ "include": "#structure-expression"
1938
+ }
1939
+ ]
1940
+ }
1941
+ ]
1942
+ }
1943
+ ]
1944
+ }
1945
+ ]
1946
+ },
1947
+ "structure-expression": {
1948
+ "patterns": [
1949
+ {
1950
+ "include": "#comment"
1951
+ },
1952
+ {
1953
+ "comment": "FIXME: scan for :upper: or `val` to disambiguate types from signatures for hover",
1954
+ "begin": "\\((?=[[:space:]]*(\\b(val)\\b|[^'\\[<[:lower:]]))",
1955
+ "end": "\\)|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|with)\\b)",
1956
+ "patterns": [
1957
+ {
1958
+ "include": "#comment"
1959
+ },
1960
+ {
1961
+ "comment": "FIXME: might need to refactor this or include more expressions",
1962
+ "include": "#structure-expression-block"
1963
+ },
1964
+ {
1965
+ "begin": "\\b(val)\\b",
1966
+ "end": "(?=\\))|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
1967
+ "beginCaptures": {
1968
+ "1": {
1969
+ "name": "keyword.other"
1970
+ }
1971
+ },
1972
+ "patterns": [
1973
+ {
1974
+ "include": "#comment"
1975
+ },
1976
+ {
1977
+ "match": "\\b([[:lower:]][[:word:]]*)\\b",
1978
+ "name": "support.class entity.name.class"
1979
+ }
1980
+ ]
1981
+ },
1982
+ {
1983
+ "include": "#module-path-simple"
1984
+ },
1985
+ {
1986
+ "begin": "(:)",
1987
+ "end": "(?=[\\)])|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val)\\b)",
1988
+ "beginCaptures": {
1989
+ "1": {
1990
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
1991
+ }
1992
+ },
1993
+ "patterns": [
1994
+ {
1995
+ "include": "#signature-expression"
1996
+ }
1997
+ ]
1998
+ }
1999
+ ]
2000
+ },
2001
+ {
2002
+ "include": "#module-path-simple"
2003
+ },
2004
+ {
2005
+ "include": "#structure-expression-block"
2006
+ }
2007
+ ]
2008
+ },
2009
+ "structure-expression-block": {
2010
+ "begin": "{",
2011
+ "end": "}",
2012
+ "patterns": [
2013
+ {
2014
+ "include": "#structure-expression-block-item"
2015
+ }
2016
+ ]
2017
+ },
2018
+ "structure-expression-block-item": {
2019
+ "patterns": [
2020
+ {
2021
+ "include": "#attribute"
2022
+ },
2023
+ {
2024
+ "include": "#comment"
2025
+ },
2026
+ {
2027
+ "include": "#module-item-exception"
2028
+ },
2029
+ {
2030
+ "include": "#module-item-external"
2031
+ },
2032
+ {
2033
+ "include": "#module-item-include"
2034
+ },
2035
+ {
2036
+ "include": "#module-item-let"
2037
+ },
2038
+ {
2039
+ "include": "#module-item-class-type"
2040
+ },
2041
+ {
2042
+ "include": "#module-item-module-type"
2043
+ },
2044
+ {
2045
+ "include": "#module-item-module"
2046
+ },
2047
+ {
2048
+ "include": "#module-item-open"
2049
+ },
2050
+ {
2051
+ "include": "#module-item-type"
2052
+ }
2053
+ ]
2054
+ },
2055
+ "type-annotation-rhs": {
2056
+ "begin": "(?<![#\\-:!?.@*/&%^+<=>|~$\\\\])([:])(?![#\\-:!?.@*/&%^+<=>|~$\\\\])",
2057
+ "end": "(?=\\))|(?=[,;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
2058
+ "beginCaptures": {
2059
+ "1": {
2060
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2061
+ }
2062
+ },
2063
+ "patterns": [
2064
+ {
2065
+ "include": "#type-expression"
2066
+ }
2067
+ ]
2068
+ },
2069
+ "type-expression": {
2070
+ "patterns": [
2071
+ {
2072
+ "match": "([\\.])",
2073
+ "name": "entity.name.function"
2074
+ },
2075
+ {
2076
+ "include": "#type-expression-atomic"
2077
+ },
2078
+ {
2079
+ "include": "#type-expression-arrow"
2080
+ }
2081
+ ]
2082
+ },
2083
+ "type-expression-atomic": {
2084
+ "patterns": [
2085
+ {
2086
+ "include": "#attribute"
2087
+ },
2088
+ {
2089
+ "include": "#comment"
2090
+ },
2091
+ {
2092
+ "include": "#module-path-extended-prefix"
2093
+ },
2094
+ {
2095
+ "include": "#type-expression-label"
2096
+ },
2097
+ {
2098
+ "match": "\\b(as)\\b",
2099
+ "name": "variable.other.class.js variable.interpolation storage.modifier message.error"
2100
+ },
2101
+ {
2102
+ "include": "#type-expression-constructor"
2103
+ },
2104
+ {
2105
+ "include": "#type-expression-object"
2106
+ },
2107
+ {
2108
+ "include": "#type-expression-parens"
2109
+ },
2110
+ {
2111
+ "include": "#type-expression-polymorphic-variant"
2112
+ },
2113
+ {
2114
+ "include": "#type-expression-record"
2115
+ },
2116
+ {
2117
+ "include": "#type-expression-variable"
2118
+ }
2119
+ ]
2120
+ },
2121
+ "type-expression-arrow": {
2122
+ "match": "=>",
2123
+ "name": "markup.inserted keyword.control.less"
2124
+ },
2125
+ "type-expression-constructor": {
2126
+ "match": "(_)(?![[:alnum:]])|\\b([_[:lower:]][[:word:]]*)\\b(?!\\.[[:upper:]])",
2127
+ "captures": {
2128
+ "1": {
2129
+ "name": "comment"
2130
+ },
2131
+ "2": {
2132
+ "name": "support.type string.regexp"
2133
+ }
2134
+ }
2135
+ },
2136
+ "type-expression-label": {
2137
+ "begin": "\\b([_[:lower:]][[:word:]]*)\\b(::)",
2138
+ "end": "(?<==>)",
2139
+ "beginCaptures": {
2140
+ "1": {
2141
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
2142
+ },
2143
+ "2": {
2144
+ "name": "keyword.control"
2145
+ }
2146
+ },
2147
+ "patterns": [
2148
+ {
2149
+ "include": "#type-expression"
2150
+ },
2151
+ {
2152
+ "match": "(\\?)",
2153
+ "captures": {
2154
+ "1": {
2155
+ "name": "keyword.control.less"
2156
+ }
2157
+ }
2158
+ }
2159
+ ]
2160
+ },
2161
+ "type-expression-object": {
2162
+ "comment": "FIXME: separate sub-rules",
2163
+ "begin": "(<)",
2164
+ "end": "(>)",
2165
+ "captures": {
2166
+ "1": {
2167
+ "name": "entity.name.function"
2168
+ }
2169
+ },
2170
+ "patterns": [
2171
+ {
2172
+ "begin": "(\\.\\.)",
2173
+ "end": "(?=>)",
2174
+ "beginCaptures": {
2175
+ "1": {
2176
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2177
+ }
2178
+ }
2179
+ },
2180
+ {
2181
+ "comment": "FIXME: method item",
2182
+ "begin": "(?=[_[:lower:]])",
2183
+ "end": "(,)|(?=>)",
2184
+ "endCaptures": {
2185
+ "1": {
2186
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2187
+ }
2188
+ },
2189
+ "patterns": [
2190
+ {
2191
+ "comment": "FIXME: method name",
2192
+ "begin": "(?=[_[:lower:]])",
2193
+ "end": "(?=:)",
2194
+ "patterns": [
2195
+ {
2196
+ "match": "\\b([_[:lower:]][[:word:]]*)\\b",
2197
+ "captures": {
2198
+ "1": {
2199
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
2200
+ }
2201
+ }
2202
+ }
2203
+ ]
2204
+ },
2205
+ {
2206
+ "comment": "FIXME: method type",
2207
+ "begin": "(:)",
2208
+ "end": "(?=[,>])",
2209
+ "beginCaptures": {
2210
+ "1": {
2211
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2212
+ }
2213
+ },
2214
+ "patterns": [
2215
+ {
2216
+ "include": "#type-expression"
2217
+ }
2218
+ ]
2219
+ }
2220
+ ]
2221
+ }
2222
+ ]
2223
+ },
2224
+ "type-expression-parens": {
2225
+ "comment": "FIXME: proper tuple types",
2226
+ "begin": "\\(",
2227
+ "end": "\\)",
2228
+ "patterns": [
2229
+ {
2230
+ "begin": "\\b(module)\\b",
2231
+ "end": "(?=[\\)])",
2232
+ "beginCaptures": {
2233
+ "1": {
2234
+ "name": "keyword.other message.error"
2235
+ }
2236
+ },
2237
+ "patterns": [
2238
+ {
2239
+ "include": "#module-path-extended"
2240
+ },
2241
+ {
2242
+ "include": "#signature-expression-constraints"
2243
+ }
2244
+ ]
2245
+ },
2246
+ {
2247
+ "match": ",",
2248
+ "name": "keyword.control.less"
2249
+ },
2250
+ {
2251
+ "include": "#type-expression"
2252
+ }
2253
+ ]
2254
+ },
2255
+ "type-expression-polymorphic-variant": {
2256
+ "comment": "FIXME: proper parsing",
2257
+ "begin": "(\\[)([<>])?",
2258
+ "end": "(\\])",
2259
+ "captures": {
2260
+ "1": {
2261
+ "name": "entity.name.function"
2262
+ },
2263
+ "2": {
2264
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2265
+ }
2266
+ },
2267
+ "patterns": [
2268
+ {
2269
+ "begin": "(\\|)?(?![#\\-:!?.@*/&%^+<=>|~$\\\\])[[:space:]]*",
2270
+ "end": "(?=[;)}\\]]|\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\])|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
2271
+ "beginCaptures": {
2272
+ "1": {
2273
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2274
+ }
2275
+ },
2276
+ "patterns": [
2277
+ {
2278
+ "include": "#value-expression-constructor"
2279
+ },
2280
+ {
2281
+ "match": "([:])|\\b(of)\\b|([&])",
2282
+ "captures": {
2283
+ "1": {
2284
+ "name": "keyword.control.less"
2285
+ },
2286
+ "2": {
2287
+ "name": "keyword.other"
2288
+ },
2289
+ "3": {
2290
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2291
+ }
2292
+ }
2293
+ },
2294
+ {
2295
+ "include": "#value-expression-constructor-polymorphic"
2296
+ },
2297
+ {
2298
+ "include": "#type-expression"
2299
+ }
2300
+ ]
2301
+ }
2302
+ ]
2303
+ },
2304
+ "type-expression-record": {
2305
+ "begin": "{",
2306
+ "end": "}",
2307
+ "patterns": [
2308
+ {
2309
+ "include": "#type-expression-record-item"
2310
+ }
2311
+ ]
2312
+ },
2313
+ "type-expression-record-field-sans-modifier": {
2314
+ "begin": "\\b([_[:lower:]][[:word:]]*)\\b",
2315
+ "end": "(,)|(?=[,}])",
2316
+ "beginCaptures": {
2317
+ "1": {
2318
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
2319
+ }
2320
+ },
2321
+ "endCaptures": {
2322
+ "1": {
2323
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2324
+ }
2325
+ },
2326
+ "patterns": [
2327
+ {
2328
+ "include": "#comment"
2329
+ },
2330
+ {
2331
+ "begin": "(:)",
2332
+ "end": "(?=[,}])",
2333
+ "beginCaptures": {
2334
+ "1": {
2335
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2336
+ }
2337
+ },
2338
+ "patterns": [
2339
+ {
2340
+ "include": "#type-expression"
2341
+ }
2342
+ ]
2343
+ }
2344
+ ]
2345
+ },
2346
+ "type-expression-record-field": {
2347
+ "patterns": [
2348
+ {
2349
+ "begin": "\\b(mutable)\\b",
2350
+ "end": "(?<=[,])|(?=})",
2351
+ "beginCaptures": {
2352
+ "1": {
2353
+ "name": "variable.other.class.js variable.interpolation storage.modifier message.error"
2354
+ }
2355
+ },
2356
+ "patterns": [
2357
+ {
2358
+ "include": "#type-expression-record-field-sans-modifier"
2359
+ }
2360
+ ]
2361
+ },
2362
+ {
2363
+ "include": "#type-expression-record-field-sans-modifier"
2364
+ }
2365
+ ]
2366
+ },
2367
+ "type-expression-record-item": {
2368
+ "patterns": [
2369
+ {
2370
+ "include": "#comment"
2371
+ },
2372
+ {
2373
+ "include": "#module-path-simple-prefix"
2374
+ },
2375
+ {
2376
+ "include": "#type-expression-record-field"
2377
+ }
2378
+ ]
2379
+ },
2380
+ "type-expression-variable": {
2381
+ "match": "(')([_[:lower:]][[:word:]]*)\\b(?!\\.[[:upper:]])",
2382
+ "captures": {
2383
+ "1": {
2384
+ "name": "comment"
2385
+ },
2386
+ "2": {
2387
+ "name": "variable.parameter string.other.link variable.language"
2388
+ }
2389
+ }
2390
+ },
2391
+ "value-expression": {
2392
+ "patterns": [
2393
+ {
2394
+ "include": "#attribute"
2395
+ },
2396
+ {
2397
+ "include": "#comment"
2398
+ },
2399
+ {
2400
+ "include": "#extension-node"
2401
+ },
2402
+ {
2403
+ "include": "#jsx"
2404
+ },
2405
+ {
2406
+ "include": "#operator"
2407
+ },
2408
+ {
2409
+ "include": "#value-expression-builtin"
2410
+ },
2411
+ {
2412
+ "include": "#value-expression-if-then-else"
2413
+ },
2414
+ {
2415
+ "include": "#value-expression-atomic"
2416
+ },
2417
+ {
2418
+ "include": "#module-path-simple-prefix"
2419
+ },
2420
+ {
2421
+ "match": "[:?]",
2422
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2423
+ },
2424
+ {
2425
+ "include": "#record-path"
2426
+ }
2427
+ ]
2428
+ },
2429
+ "value-expression-atomic": {
2430
+ "patterns": [
2431
+ {
2432
+ "include": "#value-expression-literal"
2433
+ },
2434
+ {
2435
+ "include": "#value-expression-literal-list-or-array"
2436
+ },
2437
+ {
2438
+ "include": "#value-expression-for"
2439
+ },
2440
+ {
2441
+ "include": "#value-expression-fun"
2442
+ },
2443
+ {
2444
+ "include": "#value-expression-block-or-record-or-object"
2445
+ },
2446
+ {
2447
+ "include": "#value-expression-label"
2448
+ },
2449
+ {
2450
+ "include": "#value-expression-parens"
2451
+ },
2452
+ {
2453
+ "include": "#value-expression-switch"
2454
+ },
2455
+ {
2456
+ "include": "#value-expression-try"
2457
+ },
2458
+ {
2459
+ "include": "#value-expression-while"
2460
+ }
2461
+ ]
2462
+ },
2463
+ "value-expression-atomic-with-paths": {
2464
+ "patterns": [
2465
+ {
2466
+ "include": "#value-expression-atomic"
2467
+ },
2468
+ {
2469
+ "include": "#module-path-simple-prefix"
2470
+ },
2471
+ {
2472
+ "include": "#record-path-suffix"
2473
+ }
2474
+ ]
2475
+ },
2476
+ "value-expression-block": {
2477
+ "begin": "{",
2478
+ "end": "}",
2479
+ "patterns": [
2480
+ {
2481
+ "include": "#value-expression-block-item"
2482
+ }
2483
+ ]
2484
+ },
2485
+ "value-expression-block-item": {
2486
+ "patterns": [
2487
+ {
2488
+ "include": "#module-item-let"
2489
+ },
2490
+ {
2491
+ "include": "#module-item-open"
2492
+ },
2493
+ {
2494
+ "include": "#value-expression"
2495
+ }
2496
+ ]
2497
+ },
2498
+ "value-expression-block-look": {
2499
+ "begin": "(?![[:space:]]*($|\\.\\.\\.|([[:upper:]][[:word:]]*\\.)*([[:lower:]][[:word:]]*)[[:space:]]*(?:,|:(?![=]))))",
2500
+ "end": "(?=})",
2501
+ "patterns": [
2502
+ {
2503
+ "include": "#value-expression-block-item"
2504
+ }
2505
+ ]
2506
+ },
2507
+ "value-expression-block-or-record-or-object": {
2508
+ "begin": "{",
2509
+ "end": "}",
2510
+ "patterns": [
2511
+ {
2512
+ "include": "#comment"
2513
+ },
2514
+ {
2515
+ "include": "#module-path-simple-prefix"
2516
+ },
2517
+ {
2518
+ "include": "#value-expression-object-look"
2519
+ },
2520
+ {
2521
+ "include": "#value-expression-record-look"
2522
+ },
2523
+ {
2524
+ "include": "#value-expression-block-look"
2525
+ }
2526
+ ]
2527
+ },
2528
+ "value-expression-builtin": {
2529
+ "match": "\\b(assert|decr|failwith|fprintf|ignore|incr|land|lazy|lor|lsl|lsr|lxor|mod|new|not|printf|ref)\\b|\\b(raise)\\b",
2530
+ "captures": {
2531
+ "1": {
2532
+ "name": "keyword.control message.error"
2533
+ },
2534
+ "2": {
2535
+ "name": "keyword.control.trycatch"
2536
+ }
2537
+ }
2538
+ },
2539
+ "value-expression-constructor": {
2540
+ "match": "\\b([[:upper:]][[:word:]]*)\\b(?![[:space:]]*[\\.])",
2541
+ "captures": {
2542
+ "1": {
2543
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2544
+ }
2545
+ }
2546
+ },
2547
+ "value-expression-constructor-polymorphic": {
2548
+ "match": "(`)([[:alpha:]][[:word:]]*)\\b(?!\\.)",
2549
+ "captures": {
2550
+ "1": {
2551
+ "name": "constant.other.symbol keyword.control.less variable.parameter"
2552
+ },
2553
+ "2": {
2554
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2555
+ }
2556
+ }
2557
+ },
2558
+ "value-expression-for": {
2559
+ "begin": "(?=\\b(for)\\b)",
2560
+ "end": "(?<=})|(?=[;]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
2561
+ "patterns": [
2562
+ {
2563
+ "include": "#value-expression-for-head"
2564
+ },
2565
+ {
2566
+ "include": "#value-expression-block"
2567
+ }
2568
+ ]
2569
+ },
2570
+ "value-expression-for-head": {
2571
+ "begin": "(?=\\b(for)\\b)",
2572
+ "end": "(?={)|(?=[;]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
2573
+ "patterns": [
2574
+ {
2575
+ "begin": "\\b(for)\\b",
2576
+ "end": "(?=\\b(in)\\b)|(?=[;]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
2577
+ "beginCaptures": {
2578
+ "1": {
2579
+ "name": "keyword.control.loop"
2580
+ }
2581
+ },
2582
+ "patterns": [
2583
+ {
2584
+ "include": "#comment"
2585
+ },
2586
+ {
2587
+ "include": "#pattern-variable"
2588
+ }
2589
+ ]
2590
+ },
2591
+ {
2592
+ "begin": "\\b(in)\\b",
2593
+ "end": "(?=\\b(to)\\b)|(?=[;]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
2594
+ "beginCaptures": {
2595
+ "1": {
2596
+ "name": "keyword.control.loop"
2597
+ }
2598
+ },
2599
+ "patterns": [
2600
+ {
2601
+ "include": "#comment"
2602
+ },
2603
+ {
2604
+ "include": "#value-expression-atomic-with-paths"
2605
+ }
2606
+ ]
2607
+ },
2608
+ {
2609
+ "begin": "\\b(to)\\b",
2610
+ "end": "(?={)|(?=[;]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
2611
+ "beginCaptures": {
2612
+ "1": {
2613
+ "name": "keyword.control.loop"
2614
+ }
2615
+ },
2616
+ "patterns": [
2617
+ {
2618
+ "include": "#comment"
2619
+ },
2620
+ {
2621
+ "include": "#value-expression-atomic-with-paths"
2622
+ }
2623
+ ]
2624
+ },
2625
+ {
2626
+ "include": "#value-expression-block"
2627
+ }
2628
+ ]
2629
+ },
2630
+ "value-expression-fun": {
2631
+ "begin": "\\b(fun)\\b",
2632
+ "end": "(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
2633
+ "beginCaptures": {
2634
+ "1": {
2635
+ "name": "keyword.control"
2636
+ }
2637
+ },
2638
+ "patterns": [
2639
+ {
2640
+ "include": "#value-expression-fun-pattern-match-rule-lhs"
2641
+ },
2642
+ {
2643
+ "include": "#value-expression-fun-pattern-match-rule-rhs"
2644
+ }
2645
+ ]
2646
+ },
2647
+ "value-expression-fun-pattern-match-rule-lhs": {
2648
+ "begin": "(?=\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))|(?<=fun)",
2649
+ "end": "(\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))|(?==>)|(?=[;\\)}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
2650
+ "applyEndPatternLast": true,
2651
+ "beginCaptures": {
2652
+ "1": {
2653
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2654
+ }
2655
+ },
2656
+ "endCaptures": {
2657
+ "1": {
2658
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2659
+ }
2660
+ },
2661
+ "patterns": [
2662
+ {
2663
+ "include": "#module-item-let-value-param"
2664
+ }
2665
+ ]
2666
+ },
2667
+ "value-expression-fun-pattern-match-rule-rhs": {
2668
+ "begin": "(=>)",
2669
+ "end": "(?=[;\\)}]|\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\])|\\b(and)\\b)",
2670
+ "beginCaptures": {
2671
+ "1": {
2672
+ "name": "keyword.control.less"
2673
+ }
2674
+ },
2675
+ "patterns": [
2676
+ {
2677
+ "include": "#value-expression"
2678
+ }
2679
+ ]
2680
+ },
2681
+ "value-expression-if-then-else": {
2682
+ "begin": "\\b(if)\\b",
2683
+ "end": "(?=[;\\)\\]}])",
2684
+ "applyEndPatternLast": true,
2685
+ "beginCaptures": {
2686
+ "1": {
2687
+ "name": "keyword.control.conditional"
2688
+ }
2689
+ },
2690
+ "patterns": [
2691
+ {
2692
+ "include": "#comment"
2693
+ },
2694
+ {
2695
+ "begin": "\\b(else)\\b",
2696
+ "end": "(?=[;\\)\\]}])",
2697
+ "beginCaptures": {
2698
+ "1": {
2699
+ "name": "keyword.control.conditional"
2700
+ }
2701
+ },
2702
+ "patterns": [
2703
+ {
2704
+ "include": "#value-expression"
2705
+ }
2706
+ ]
2707
+ },
2708
+ {
2709
+ "include": "#value-expression-atomic-with-paths"
2710
+ }
2711
+ ]
2712
+ },
2713
+ "value-expression-lazy": {
2714
+ "comment": "FIXME",
2715
+ "match": "\\b(lazy)\\b",
2716
+ "captures": {
2717
+ "1": {
2718
+ "name": "keyword.other"
2719
+ }
2720
+ }
2721
+ },
2722
+ "value-expression-label": {
2723
+ "begin": "\\b([_[:lower:]][[:word:]]*)\\b[[:space:]]*(::)(\\?)?",
2724
+ "end": "(?![[:space:]])",
2725
+ "beginCaptures": {
2726
+ "1": {
2727
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
2728
+ },
2729
+ "2": {
2730
+ "name": "keyword.control"
2731
+ },
2732
+ "3": {
2733
+ "name": "storage.type"
2734
+ }
2735
+ },
2736
+ "patterns": [
2737
+ {
2738
+ "include": "#value-expression"
2739
+ }
2740
+ ]
2741
+ },
2742
+ "value-expression-literal": {
2743
+ "patterns": [
2744
+ {
2745
+ "include": "#value-expression-literal-boolean"
2746
+ },
2747
+ {
2748
+ "include": "#value-expression-literal-character"
2749
+ },
2750
+ {
2751
+ "include": "#value-expression-constructor"
2752
+ },
2753
+ {
2754
+ "include": "#value-expression-constructor-polymorphic"
2755
+ },
2756
+ {
2757
+ "include": "#value-expression-lazy"
2758
+ },
2759
+ {
2760
+ "include": "#value-expression-literal-numeric"
2761
+ },
2762
+ {
2763
+ "include": "#value-expression-literal-string"
2764
+ },
2765
+ {
2766
+ "include": "#value-expression-literal-unit"
2767
+ }
2768
+ ]
2769
+ },
2770
+ "value-expression-literal-boolean": {
2771
+ "match": "\\b(false|true)\\b",
2772
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2773
+ },
2774
+ "value-expression-literal-character": {
2775
+ "match": "(')([[:space:]]|[[:graph:]]|\\\\[\\\\\"'ntbr]|\\\\[[:digit:]][[:digit:]][[:digit:]]|\\\\x[[:xdigit:]][[:xdigit:]]|\\\\o[0-3][0-7][0-7])(')",
2776
+ "name": "constant.character"
2777
+ },
2778
+ "value-expression-literal-list-or-array": {
2779
+ "begin": "(\\[\\|?)(?![@%])",
2780
+ "end": "(\\|?\\])",
2781
+ "beginCaptures": {
2782
+ "1": {
2783
+ "name": "constant.language.list"
2784
+ }
2785
+ },
2786
+ "endCaptures": {
2787
+ "1": {
2788
+ "name": "constant.language.list"
2789
+ }
2790
+ },
2791
+ "patterns": [
2792
+ {
2793
+ "include": "#value-expression-literal-list-or-array-separator"
2794
+ },
2795
+ {
2796
+ "include": "#value-expression"
2797
+ },
2798
+ {
2799
+ "include": "#value-expression-literal-list-or-array"
2800
+ }
2801
+ ]
2802
+ },
2803
+ "value-expression-literal-list-or-array-separator": {
2804
+ "match": "(,)|(\\.\\.\\.)",
2805
+ "captures": {
2806
+ "1": {
2807
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2808
+ },
2809
+ "2": {
2810
+ "name": "keyword.control"
2811
+ }
2812
+ }
2813
+ },
2814
+ "value-expression-literal-numeric": {
2815
+ "patterns": [
2816
+ {
2817
+ "match": "([-])?([[:digit:]][_[:digit:]]*)(?:(\\.)([_[:digit:]]*))?(?:([eE])([\\-\\+])?([[:digit:]][_[:digit:]]*))?(?![bBoOxX])",
2818
+ "captures": {
2819
+ "1": {
2820
+ "name": "keyword.control.less"
2821
+ },
2822
+ "2": {
2823
+ "name": "constant.numeric"
2824
+ },
2825
+ "3": {
2826
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2827
+ },
2828
+ "4": {
2829
+ "name": "constant.numeric"
2830
+ },
2831
+ "5": {
2832
+ "name": "keyword.control.less"
2833
+ },
2834
+ "6": {
2835
+ "name": "keyword.control.less"
2836
+ },
2837
+ "7": {
2838
+ "name": "constant.numeric"
2839
+ }
2840
+ }
2841
+ },
2842
+ {
2843
+ "match": "([-])?(0[xX])([[:xdigit:]][_[:xdigit:]]*)(?:(\\.)([_[:xdigit:]]*))?(?:([pP])([\\-\\+])?([[:digit:]][_[:digit:]]*))?",
2844
+ "captures": {
2845
+ "1": {
2846
+ "name": "keyword.control.less"
2847
+ },
2848
+ "2": {
2849
+ "name": "keyword.control.less"
2850
+ },
2851
+ "3": {
2852
+ "name": "constant.numeric"
2853
+ },
2854
+ "4": {
2855
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
2856
+ },
2857
+ "5": {
2858
+ "name": "constant.numeric"
2859
+ },
2860
+ "6": {
2861
+ "name": "keyword.control.less"
2862
+ },
2863
+ "7": {
2864
+ "name": "keyword.control.less"
2865
+ },
2866
+ "8": {
2867
+ "name": "constant.numeric"
2868
+ }
2869
+ }
2870
+ },
2871
+ {
2872
+ "match": "([-])?(0[oO])([0-7][_0-7]*)",
2873
+ "captures": {
2874
+ "1": {
2875
+ "name": "keyword.control.less"
2876
+ },
2877
+ "2": {
2878
+ "name": "keyword.control.less"
2879
+ },
2880
+ "3": {
2881
+ "name": "constant.numeric"
2882
+ }
2883
+ }
2884
+ },
2885
+ {
2886
+ "match": "([-])?(0[bB])([0-1][_0-1]*)",
2887
+ "captures": {
2888
+ "1": {
2889
+ "name": "keyword.control.less"
2890
+ },
2891
+ "2": {
2892
+ "name": "keyword.control.less"
2893
+ },
2894
+ "3": {
2895
+ "name": "constant.numeric"
2896
+ }
2897
+ }
2898
+ }
2899
+ ]
2900
+ },
2901
+ "value-expression-literal-string": {
2902
+ "patterns": [
2903
+ {
2904
+ "begin": "(?<![[:alpha:]])js_expr(?!=[[:word:]])",
2905
+ "end": "(?<=\")|(\\|)([_[:lower:]]*)?(})|(?=[^[:space:]\"{])",
2906
+ "endCaptures": {
2907
+ "1": {
2908
+ "name": "keyword.control.flow message.error"
2909
+ },
2910
+ "2": {
2911
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2912
+ },
2913
+ "3": {
2914
+ "name": "keyword.control.flow message.error"
2915
+ }
2916
+ },
2917
+ "patterns": [
2918
+ {
2919
+ "begin": "({)([_[:lower:]]*)?(\\|)",
2920
+ "end": "(?=\\|\\2})",
2921
+ "comment": "meta.separator",
2922
+ "beginCaptures": {
2923
+ "1": {
2924
+ "name": "keyword.control.flow message.error"
2925
+ },
2926
+ "2": {
2927
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2928
+ },
2929
+ "3": {
2930
+ "name": "keyword.control.flow message.error"
2931
+ }
2932
+ },
2933
+ "patterns": [
2934
+ {
2935
+ "include": "source.js"
2936
+ }
2937
+ ]
2938
+ },
2939
+ {
2940
+ "begin": "\"",
2941
+ "end": "\"",
2942
+ "comment": "meta.separator",
2943
+ "patterns": [
2944
+ {
2945
+ "include": "source.js"
2946
+ }
2947
+ ]
2948
+ }
2949
+ ]
2950
+ },
2951
+ {
2952
+ "begin": "({)([_[:lower:]]*)?(\\|)",
2953
+ "end": "(\\|)(\\2)(})",
2954
+ "name": "string.double string.regexp",
2955
+ "beginCaptures": {
2956
+ "1": {
2957
+ "name": "keyword.control.flow message.error"
2958
+ },
2959
+ "2": {
2960
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2961
+ },
2962
+ "3": {
2963
+ "name": "keyword.control.flow message.error"
2964
+ }
2965
+ },
2966
+ "endCaptures": {
2967
+ "1": {
2968
+ "name": "keyword.control.flow message.error"
2969
+ },
2970
+ "2": {
2971
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
2972
+ },
2973
+ "3": {
2974
+ "name": "keyword.control.flow message.error"
2975
+ }
2976
+ }
2977
+ },
2978
+ {
2979
+ "begin": "\"",
2980
+ "end": "\"",
2981
+ "name": "string.double string.regexp",
2982
+ "patterns": [
2983
+ {
2984
+ "include": "#value-expression-literal-string-escape"
2985
+ }
2986
+ ]
2987
+ }
2988
+ ]
2989
+ },
2990
+ "value-expression-literal-string-escape": {
2991
+ "patterns": [
2992
+ {
2993
+ "comment": "FIXME: make escapes into separate rule",
2994
+ "match": "\\\\[\\\\\"'ntbr ]|\\\\[[:digit:]][[:digit:]][[:digit:]]|\\\\x[[:xdigit:]][[:xdigit:]]|\\\\o[0-3][0-7][0-7]",
2995
+ "name": "constant.character"
2996
+ },
2997
+ {
2998
+ "match": "(@)([ \\[\\],.]|\\\\n)",
2999
+ "captures": {
3000
+ "1": {
3001
+ "name": "keyword.control.less"
3002
+ },
3003
+ "2": {
3004
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
3005
+ }
3006
+ }
3007
+ },
3008
+ {
3009
+ "comment": "FIXME: don't highlight in external strings",
3010
+ "match": "(%)([ads])?",
3011
+ "captures": {
3012
+ "1": {
3013
+ "name": "entity.other.attribute-name.css constant.language constant.numeric"
3014
+ },
3015
+ "2": {
3016
+ "name": "variable.other.readwrite.instance string.other.link variable.language"
3017
+ }
3018
+ }
3019
+ }
3020
+ ]
3021
+ },
3022
+ "value-expression-literal-unit": {
3023
+ "match": "\\(\\)",
3024
+ "name": "constant.language.unit"
3025
+ },
3026
+ "value-expression-object-look": {
3027
+ "comment": "FIXME: is there a better way than listing all the keywords?",
3028
+ "begin": "(?:\\G|^)[[:space:]]*(?=method)",
3029
+ "end": "(?=})",
3030
+ "patterns": [
3031
+ {
3032
+ "include": "#object-item"
3033
+ }
3034
+ ]
3035
+ },
3036
+ "value-expression-parens": {
3037
+ "begin": "(?=\\()",
3038
+ "end": "(\\))|(?=[;}]|\\b(and|class|constraint|exception|external|include|inherit|let|method|module|nonrec|open|private|rec|type|val|with)\\b)",
3039
+ "endCaptures": {
3040
+ },
3041
+ "patterns": [
3042
+ {
3043
+ "include": "#condition-lhs"
3044
+ },
3045
+ {
3046
+ "include": "#value-expression-parens-lhs"
3047
+ },
3048
+ {
3049
+ "include": "#type-annotation-rhs"
3050
+ }
3051
+ ]
3052
+ },
3053
+ "value-expression-parens-lhs": {
3054
+ "begin": "(\\()|(,)",
3055
+ "end": "(?=[?,:\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3056
+ "beginCaptures": {
3057
+ "2": {
3058
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3059
+ }
3060
+ },
3061
+ "patterns": [
3062
+ {
3063
+ "begin": "\\b(module)\\b",
3064
+ "end": "(?=\\))",
3065
+ "beginCaptures": {
3066
+ "1": {
3067
+ "name": "keyword.other message.error"
3068
+ }
3069
+ },
3070
+ "patterns": [
3071
+ {
3072
+ "include": "#module-path-simple"
3073
+ }
3074
+ ]
3075
+ },
3076
+ {
3077
+ "include": "#value-expression"
3078
+ }
3079
+ ]
3080
+ },
3081
+ "value-expression-record-field": {
3082
+ "patterns": [
3083
+ {
3084
+ "begin": "(\\.\\.\\.)",
3085
+ "end": "(,)|(?=})",
3086
+ "beginCaptures": {
3087
+ "1": {
3088
+ "name": "keyword.control"
3089
+ }
3090
+ },
3091
+ "endCaptures": {
3092
+ "1": {
3093
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3094
+ }
3095
+ },
3096
+ "patterns": [
3097
+ {
3098
+ "include": "#comment"
3099
+ },
3100
+ {
3101
+ "include": "#module-path-simple-prefix"
3102
+ },
3103
+ {
3104
+ "begin": "(?=[\\.])",
3105
+ "end": "(?=[:,])",
3106
+ "patterns": [
3107
+ {
3108
+ "match": "\\b[[:lower:]][[:word:]]*\\b",
3109
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
3110
+ }
3111
+ ]
3112
+ },
3113
+ {
3114
+ "begin": "(:)",
3115
+ "end": "(?=[,}])",
3116
+ "beginCaptures": {
3117
+ "1": {
3118
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3119
+ }
3120
+ },
3121
+ "patterns": [
3122
+ {
3123
+ "include": "#value-expression"
3124
+ }
3125
+ ]
3126
+ }
3127
+ ]
3128
+ },
3129
+ {
3130
+ "begin": "\\b[[:upper:]][[:word:]]*\\b",
3131
+ "end": "(,)|(?=})",
3132
+ "beginCaptures": {
3133
+ "1": {
3134
+ "name": "support.class entity.name.class"
3135
+ }
3136
+ },
3137
+ "endCaptures": {
3138
+ "1": {
3139
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3140
+ }
3141
+ },
3142
+ "patterns": [
3143
+ {
3144
+ "include": "#module-path-simple-prefix"
3145
+ },
3146
+ {
3147
+ "begin": "(:)",
3148
+ "end": "(?=[,}])",
3149
+ "beginCaptures": {
3150
+ "1": {
3151
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3152
+ }
3153
+ },
3154
+ "patterns": [
3155
+ {
3156
+ "include": "#value-expression"
3157
+ }
3158
+ ]
3159
+ }
3160
+ ]
3161
+ },
3162
+ {
3163
+ "begin": "\\b([[:lower:]][[:word:]]*)\\b",
3164
+ "end": "(,)|(?=})",
3165
+ "beginCaptures": {
3166
+ "1": {
3167
+ "name": "markup.inserted constant.language support.property-value entity.name.filename"
3168
+ }
3169
+ },
3170
+ "endCaptures": {
3171
+ "1": {
3172
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3173
+ }
3174
+ },
3175
+ "patterns": [
3176
+ {
3177
+ "begin": "(:)",
3178
+ "end": "(?=[,}])",
3179
+ "beginCaptures": {
3180
+ "1": {
3181
+ "name": "variable.other.class.js variable.interpolation keyword.operator keyword.control message.error"
3182
+ }
3183
+ },
3184
+ "patterns": [
3185
+ {
3186
+ "include": "#value-expression"
3187
+ }
3188
+ ]
3189
+ }
3190
+ ]
3191
+ }
3192
+ ]
3193
+ },
3194
+ "value-expression-record-item": {
3195
+ "patterns": [
3196
+ {
3197
+ "include": "#comment"
3198
+ },
3199
+ {
3200
+ "include": "#module-path-simple-prefix"
3201
+ },
3202
+ {
3203
+ "include": "#value-expression-record-field"
3204
+ }
3205
+ ]
3206
+ },
3207
+ "value-expression-switch": {
3208
+ "begin": "\\b(switch)\\b",
3209
+ "end": "(?<=})",
3210
+ "beginCaptures": {
3211
+ "1": {
3212
+ "name": "keyword.control.switch"
3213
+ }
3214
+ },
3215
+ "patterns": [
3216
+ {
3217
+ "include": "#value-expression-switch-head"
3218
+ },
3219
+ {
3220
+ "include": "#value-expression-switch-body"
3221
+ }
3222
+ ]
3223
+ },
3224
+ "value-expression-switch-body": {
3225
+ "begin": "{",
3226
+ "end": "}",
3227
+ "patterns": [
3228
+ {
3229
+ "include": "#comment"
3230
+ },
3231
+ {
3232
+ "include": "#value-expression-switch-pattern-match-rule"
3233
+ }
3234
+ ]
3235
+ },
3236
+ "value-expression-switch-head": {
3237
+ "begin": "(?<=switch)",
3238
+ "end": "(?<!switch)(?={)|(?=[;\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3239
+ "patterns": [
3240
+ {
3241
+ "include": "#comment"
3242
+ },
3243
+ {
3244
+ "begin": "\\G[[:space:]]*+{",
3245
+ "end": "}[[:space:]]*+",
3246
+ "patterns": [
3247
+ {
3248
+ "include": "#value-expression-block-item"
3249
+ }
3250
+ ]
3251
+ },
3252
+ {
3253
+ "include": "#value-expression-atomic-with-paths"
3254
+ }
3255
+ ]
3256
+ },
3257
+ "value-expression-switch-pattern-match-rule": {
3258
+ "patterns": [
3259
+ {
3260
+ "include": "#value-expression-switch-pattern-match-rule-lhs"
3261
+ },
3262
+ {
3263
+ "include": "#value-expression-switch-pattern-match-rule-rhs"
3264
+ }
3265
+ ]
3266
+ },
3267
+ "value-expression-switch-pattern-match-rule-lhs": {
3268
+ "begin": "(?=\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))",
3269
+ "end": "(?==>|[;\\)}])",
3270
+ "patterns": [
3271
+ {
3272
+ "include": "#pattern-guard"
3273
+ },
3274
+ {
3275
+ "include": "#pattern"
3276
+ }
3277
+ ]
3278
+ },
3279
+ "value-expression-switch-pattern-match-rule-rhs": {
3280
+ "begin": "(=>)",
3281
+ "end": "(?=}|\\|(?![#\\-:!?.@*/&%^+<=>|~$\\\\]))",
3282
+ "beginCaptures": {
3283
+ "1": {
3284
+ "name": "keyword.control.less"
3285
+ }
3286
+ },
3287
+ "patterns": [
3288
+ {
3289
+ "include": "#value-expression-block-item"
3290
+ }
3291
+ ]
3292
+ },
3293
+ "value-expression-try": {
3294
+ "begin": "\\b(try)\\b",
3295
+ "end": "(?<=})|(?=[;\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3296
+ "beginCaptures": {
3297
+ "1": {
3298
+ "name": "keyword.control.trycatch"
3299
+ }
3300
+ },
3301
+ "patterns": [
3302
+ {
3303
+ "include": "#value-expression-try-head"
3304
+ },
3305
+ {
3306
+ "include": "#value-expression-switch-body"
3307
+ }
3308
+ ]
3309
+ },
3310
+ "value-expression-try-head": {
3311
+ "begin": "(?<=try)",
3312
+ "end": "(?<!try)(?={)|(?=[;\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3313
+ "beginCaptures": {
3314
+ "1": {
3315
+ "name": "keyword.control"
3316
+ }
3317
+ },
3318
+ "patterns": [
3319
+ {
3320
+ "include": "#comment"
3321
+ },
3322
+ {
3323
+ "begin": "\\G[[:space:]]*+{",
3324
+ "end": "}[[:space:]]*+",
3325
+ "patterns": [
3326
+ {
3327
+ "include": "#value-expression-block-item"
3328
+ }
3329
+ ]
3330
+ },
3331
+ {
3332
+ "include": "#value-expression-atomic-with-paths"
3333
+ }
3334
+ ]
3335
+ },
3336
+ "value-expression-while": {
3337
+ "begin": "\\b(while)\\b",
3338
+ "end": "(?<=})|(?=[;\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3339
+ "beginCaptures": {
3340
+ "1": {
3341
+ "name": "keyword.control.loop"
3342
+ }
3343
+ },
3344
+ "patterns": [
3345
+ {
3346
+ "include": "#value-expression-while-head"
3347
+ },
3348
+ {
3349
+ "include": "#value-expression-block"
3350
+ }
3351
+ ]
3352
+ },
3353
+ "value-expression-while-head": {
3354
+ "begin": "(?<=while)[[:space:]]*+",
3355
+ "end": "(?={)|(?=[;\\)]|\\b(and|as|class|constraint|exception|external|include|inherit|let|method|nonrec|open|private|rec|type|val|with)\\b)",
3356
+ "patterns": [
3357
+ {
3358
+ "include": "#comment"
3359
+ },
3360
+ {
3361
+ "include": "#value-expression-atomic-with-paths"
3362
+ }
3363
+ ]
3364
+ },
3365
+ "value-expression-record-look": {
3366
+ "begin": "(?=\\.\\.\\.|([[:upper:]][[:word:]]*\\.)*([[:lower:]][[:word:]]*)[[:space:]]*[,:}])",
3367
+ "end": "(?=})",
3368
+ "patterns": [
3369
+ {
3370
+ "include": "#value-expression-record-item"
3371
+ }
3372
+ ]
3373
+ }
3374
+ }
296
3375
  }