@mirascript/textmate 0.1.85 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/grammar.d.ts.map +1 -1
- package/dist/grammar.js +139 -126
- package/dist/grammar.js.map +1 -1
- package/dist/mirascript-template.tmLanguage.json +224 -0
- package/dist/mirascript.tmLanguage.json +222 -0
- package/package.json +2 -2
- package/src/grammar.ts +140 -126
- package/tests/grammar/strings.ts +11 -0
package/dist/grammar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAgoB3D;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,oBAAoB,CAW9D;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,oBAAoB,CAUtE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,oBAAoB,CAgfjE"}
|
package/dist/grammar.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CONSTANT_KEYWORDS, CONTROL_KEYWORDS, KEYWORDS, NUMERIC_KEYWORDS, REG_IDENTIFIER, RESERVED_KEYWORDS, } from '@mirascript/constants';
|
|
2
2
|
import { mirascriptDocLanguage, mirascriptLanguage, mirascriptTemplateLanguage } from "./language.js";
|
|
3
|
-
const SCOPE_SUFFIX = 'mira';
|
|
4
3
|
const IDENTIFIER = REG_IDENTIFIER.source;
|
|
5
4
|
const IDENTIFIER_START = String.raw `(?<!\p{XID_Continue})`;
|
|
6
5
|
const IDENTIFIER_END = String.raw `(?!\p{XID_Continue})`;
|
|
@@ -70,33 +69,35 @@ function interpolationPatterns(dollarCount) {
|
|
|
70
69
|
const dollars = String.raw `\$`.repeat(dollarCount);
|
|
71
70
|
return [
|
|
72
71
|
{
|
|
73
|
-
name: `meta.interpolation.simple
|
|
72
|
+
name: `meta.interpolation.simple.mira`,
|
|
74
73
|
match: `(${dollars})(${IDENTIFIER})`,
|
|
75
74
|
captures: {
|
|
76
|
-
1: { name: `punctuation.definition.template-expression.begin
|
|
77
|
-
2: { name: `variable.other
|
|
75
|
+
1: { name: `punctuation.definition.template-expression.begin.mira` },
|
|
76
|
+
2: { name: `variable.other.mira` },
|
|
78
77
|
},
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
|
-
name: `meta.interpolation.block
|
|
80
|
+
name: `meta.interpolation.block.mira`,
|
|
82
81
|
begin: String.raw `(${dollars}\{)`,
|
|
83
|
-
beginCaptures: { 1: { name: `punctuation.definition.template-expression.begin
|
|
82
|
+
beginCaptures: { 1: { name: `punctuation.definition.template-expression.begin.mira` } },
|
|
83
|
+
contentName: `meta.embedded.expression.mira`,
|
|
84
84
|
end: String.raw `\}`,
|
|
85
|
-
endCaptures: { 0: { name: `punctuation.definition.template-expression.end
|
|
85
|
+
endCaptures: { 0: { name: `punctuation.definition.template-expression.end.mira` } },
|
|
86
86
|
patterns: [{ include: '#braced-content' }],
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
name: `meta.interpolation.expression
|
|
89
|
+
name: `meta.interpolation.expression.mira`,
|
|
90
90
|
begin: String.raw `(${dollars}\()`,
|
|
91
|
-
beginCaptures: { 1: { name: `punctuation.definition.template-expression.begin
|
|
91
|
+
beginCaptures: { 1: { name: `punctuation.definition.template-expression.begin.mira` } },
|
|
92
|
+
contentName: `meta.embedded.expression.mira`,
|
|
92
93
|
end: String.raw `\)`,
|
|
93
|
-
endCaptures: { 0: { name: `punctuation.definition.template-expression.end
|
|
94
|
+
endCaptures: { 0: { name: `punctuation.definition.template-expression.end.mira` } },
|
|
94
95
|
patterns: [
|
|
95
96
|
{
|
|
96
97
|
begin: ':(?!:)',
|
|
97
|
-
beginCaptures: { 0: { name: `punctuation.separator.format
|
|
98
|
+
beginCaptures: { 0: { name: `punctuation.separator.format.mira` } },
|
|
98
99
|
end: String.raw `(?=\))`,
|
|
99
|
-
contentName: `string.unquoted.format
|
|
100
|
+
contentName: `string.unquoted.format.mira`,
|
|
100
101
|
patterns: [{ include: '#format-content' }],
|
|
101
102
|
},
|
|
102
103
|
{ include: '#interpolation-expression-content' },
|
|
@@ -110,16 +111,16 @@ function interpolationPatterns(dollarCount) {
|
|
|
110
111
|
function normalString(quote, label) {
|
|
111
112
|
const escapedQuote = escapeRegex(quote);
|
|
112
113
|
return {
|
|
113
|
-
name: `string.quoted.${label}
|
|
114
|
+
name: `string.quoted.${label}.mira`,
|
|
114
115
|
begin: escapedQuote,
|
|
115
|
-
beginCaptures: { 0: { name: `punctuation.definition.string.begin
|
|
116
|
+
beginCaptures: { 0: { name: `punctuation.definition.string.begin.mira` } },
|
|
116
117
|
end: escapedQuote,
|
|
117
|
-
endCaptures: { 0: { name: `punctuation.definition.string.end
|
|
118
|
+
endCaptures: { 0: { name: `punctuation.definition.string.end.mira` } },
|
|
118
119
|
patterns: [
|
|
119
|
-
{ name: `constant.character.escape.unicode
|
|
120
|
-
{ name: `constant.character.escape.hex
|
|
121
|
-
{ name: `constant.character.escape
|
|
122
|
-
{ name: `invalid.illegal.escape
|
|
120
|
+
{ name: `constant.character.escape.unicode.mira`, match: String.raw `\\u\{[0-9A-Fa-f]+\}` },
|
|
121
|
+
{ name: `constant.character.escape.hex.mira`, match: String.raw `\\x[0-9A-Fa-f]{2}` },
|
|
122
|
+
{ name: `constant.character.escape.mira`, match: '\\\\[\\\\\'"\\`$rntbfv0]' },
|
|
123
|
+
{ name: `invalid.illegal.escape.mira`, match: String.raw `\\.` },
|
|
123
124
|
...interpolationPatterns(1),
|
|
124
125
|
],
|
|
125
126
|
};
|
|
@@ -131,11 +132,11 @@ function verbatimString(atCount, quote, label) {
|
|
|
131
132
|
const ats = '@'.repeat(atCount);
|
|
132
133
|
const escapedQuote = escapeRegex(quote);
|
|
133
134
|
return {
|
|
134
|
-
name: `string.quoted.${label}.verbatim
|
|
135
|
+
name: `string.quoted.${label}.verbatim.mira`,
|
|
135
136
|
begin: `(?<!@)${ats}${escapedQuote}`,
|
|
136
|
-
beginCaptures: { 0: { name: `punctuation.definition.string.begin
|
|
137
|
+
beginCaptures: { 0: { name: `punctuation.definition.string.begin.mira` } },
|
|
137
138
|
end: `${escapedQuote}${ats}(?!@)`,
|
|
138
|
-
endCaptures: { 0: { name: `punctuation.definition.string.end
|
|
139
|
+
endCaptures: { 0: { name: `punctuation.definition.string.end.mira` } },
|
|
139
140
|
patterns: interpolationPatterns(atCount),
|
|
140
141
|
};
|
|
141
142
|
}
|
|
@@ -153,6 +154,18 @@ function stringPatterns() {
|
|
|
153
154
|
...quotes.map(([quote, label]) => normalString(quote, label)),
|
|
154
155
|
];
|
|
155
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Create a balanced-delimiter rule whose begin and end retain punctuation scopes.
|
|
159
|
+
*/
|
|
160
|
+
function delimitedContent(delimiter, begin, end, include) {
|
|
161
|
+
return {
|
|
162
|
+
begin,
|
|
163
|
+
beginCaptures: { 0: { name: `punctuation.section.${delimiter}.begin.mira` } },
|
|
164
|
+
end,
|
|
165
|
+
endCaptures: { 0: { name: `punctuation.section.${delimiter}.end.mira` } },
|
|
166
|
+
patterns: [{ include }],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
156
169
|
/**
|
|
157
170
|
* Build the documentation-comment rules shared by source and doc grammars.
|
|
158
171
|
*/
|
|
@@ -169,15 +182,15 @@ function documentationRepository(sourceInclude = '#source') {
|
|
|
169
182
|
'documentation-inline': {
|
|
170
183
|
patterns: [
|
|
171
184
|
{
|
|
172
|
-
name: `storage.type.class.documentation
|
|
185
|
+
name: `storage.type.class.documentation.mira`,
|
|
173
186
|
match: String.raw `@(param|returns)\b`,
|
|
174
187
|
},
|
|
175
188
|
{
|
|
176
|
-
name: `markup.bold.documentation
|
|
189
|
+
name: `markup.bold.documentation.mira`,
|
|
177
190
|
match: String.raw `\*\*[^*]+\*\*`,
|
|
178
191
|
},
|
|
179
|
-
{ name: `markup.italic.documentation
|
|
180
|
-
{ name: `constant.character.escape.documentation
|
|
192
|
+
{ name: `markup.italic.documentation.mira`, match: String.raw `\*[^*]+\*` },
|
|
193
|
+
{ name: `constant.character.escape.documentation.mira`, match: String.raw `\\\*` },
|
|
181
194
|
],
|
|
182
195
|
},
|
|
183
196
|
'documentation-line': {
|
|
@@ -185,9 +198,9 @@ function documentationRepository(sourceInclude = '#source') {
|
|
|
185
198
|
{
|
|
186
199
|
match: String.raw `^(?!\s*\*/)(\s*\*\s?)(.*?)(?=\*/|$)`,
|
|
187
200
|
captures: {
|
|
188
|
-
1: { name: `comment.block.documentation
|
|
201
|
+
1: { name: `comment.block.documentation.mira` },
|
|
189
202
|
2: {
|
|
190
|
-
name: `meta.documentation.inline
|
|
203
|
+
name: `meta.documentation.inline.mira`,
|
|
191
204
|
patterns: [{ include: '#documentation-inline' }],
|
|
192
205
|
},
|
|
193
206
|
},
|
|
@@ -200,7 +213,7 @@ function documentationRepository(sourceInclude = '#source') {
|
|
|
200
213
|
match: String.raw `(?!\*/)(.+?)(?=\*/|$)`,
|
|
201
214
|
captures: {
|
|
202
215
|
1: {
|
|
203
|
-
name: `meta.documentation.inline
|
|
216
|
+
name: `meta.documentation.inline.mira`,
|
|
204
217
|
patterns: [{ include: '#documentation-inline' }],
|
|
205
218
|
},
|
|
206
219
|
},
|
|
@@ -210,34 +223,34 @@ function documentationRepository(sourceInclude = '#source') {
|
|
|
210
223
|
'documentation-mirascript-fence': {
|
|
211
224
|
patterns: [
|
|
212
225
|
{
|
|
213
|
-
name: `markup.fenced_code.block
|
|
226
|
+
name: `markup.fenced_code.block.mira`,
|
|
214
227
|
begin: documentationMiraFenceBegin,
|
|
215
228
|
beginCaptures: {
|
|
216
|
-
1: { name: `comment.block.documentation
|
|
217
|
-
2: { name: `punctuation.definition.markdown
|
|
218
|
-
3: { name: `fenced_code.block.language
|
|
229
|
+
1: { name: `comment.block.documentation.mira` },
|
|
230
|
+
2: { name: `punctuation.definition.markdown.mira` },
|
|
231
|
+
3: { name: `fenced_code.block.language.mira` },
|
|
219
232
|
},
|
|
220
233
|
end: documentationFenceEnd,
|
|
221
234
|
endCaptures: {
|
|
222
|
-
1: { name: `comment.block.documentation
|
|
223
|
-
2: { name: `punctuation.definition.markdown
|
|
235
|
+
1: { name: `comment.block.documentation.mira` },
|
|
236
|
+
2: { name: `punctuation.definition.markdown.mira` },
|
|
224
237
|
},
|
|
225
238
|
patterns: [
|
|
226
239
|
{
|
|
227
|
-
name: `meta.embedded.block
|
|
228
|
-
contentName: `source
|
|
240
|
+
name: `meta.embedded.block.mira`,
|
|
241
|
+
contentName: `source.mira`,
|
|
229
242
|
begin: documentationMiraLine,
|
|
230
243
|
beginCaptures: {
|
|
231
|
-
1: { name: `comment.block.documentation
|
|
244
|
+
1: { name: `comment.block.documentation.mira` },
|
|
232
245
|
},
|
|
233
246
|
while: documentationMiraLine,
|
|
234
247
|
whileCaptures: {
|
|
235
|
-
1: { name: `comment.block.documentation
|
|
248
|
+
1: { name: `comment.block.documentation.mira` },
|
|
236
249
|
},
|
|
237
250
|
patterns: [{ include: sourceInclude }],
|
|
238
251
|
},
|
|
239
252
|
{
|
|
240
|
-
name: `comment.block.documentation
|
|
253
|
+
name: `comment.block.documentation.mira`,
|
|
241
254
|
match: String.raw `^(?!\s*\*/)(\s*\*\s?)`,
|
|
242
255
|
},
|
|
243
256
|
],
|
|
@@ -247,22 +260,22 @@ function documentationRepository(sourceInclude = '#source') {
|
|
|
247
260
|
'documentation-other-fence': {
|
|
248
261
|
patterns: [
|
|
249
262
|
{
|
|
250
|
-
name: `markup.fenced_code.block
|
|
251
|
-
contentName: `markup.raw.block
|
|
263
|
+
name: `markup.fenced_code.block.mira`,
|
|
264
|
+
contentName: `markup.raw.block.mira`,
|
|
252
265
|
begin: documentationOtherFenceBegin,
|
|
253
266
|
beginCaptures: {
|
|
254
|
-
1: { name: `comment.block.documentation
|
|
255
|
-
2: { name: `punctuation.definition.markdown
|
|
256
|
-
3: { name: `fenced_code.block.language
|
|
267
|
+
1: { name: `comment.block.documentation.mira` },
|
|
268
|
+
2: { name: `punctuation.definition.markdown.mira` },
|
|
269
|
+
3: { name: `fenced_code.block.language.mira` },
|
|
257
270
|
},
|
|
258
271
|
end: documentationFenceEnd,
|
|
259
272
|
endCaptures: {
|
|
260
|
-
1: { name: `comment.block.documentation
|
|
261
|
-
2: { name: `punctuation.definition.markdown
|
|
273
|
+
1: { name: `comment.block.documentation.mira` },
|
|
274
|
+
2: { name: `punctuation.definition.markdown.mira` },
|
|
262
275
|
},
|
|
263
276
|
patterns: [
|
|
264
277
|
{
|
|
265
|
-
name: `comment.block.documentation
|
|
278
|
+
name: `comment.block.documentation.mira`,
|
|
266
279
|
match: String.raw `^(?!\s*\*/)(\s*\*\s?)`,
|
|
267
280
|
},
|
|
268
281
|
],
|
|
@@ -279,7 +292,7 @@ function sourceRepository() {
|
|
|
279
292
|
* Create a boundary-aware TextMate keyword rule.
|
|
280
293
|
*/
|
|
281
294
|
const keywordRule = (values, name) => ({
|
|
282
|
-
name: `${name}
|
|
295
|
+
name: `${name}.mira`,
|
|
283
296
|
match: `${IDENTIFIER_START}(?:${alternatives(values)})${IDENTIFIER_END}`,
|
|
284
297
|
});
|
|
285
298
|
const keywordPatterns = [
|
|
@@ -314,29 +327,29 @@ function sourceRepository() {
|
|
|
314
327
|
},
|
|
315
328
|
comments: {
|
|
316
329
|
patterns: [
|
|
317
|
-
{ name: `comment.line.double-slash
|
|
330
|
+
{ name: `comment.line.double-slash.mira`, match: '//.*$' },
|
|
318
331
|
{
|
|
319
|
-
name: `comment.block.documentation
|
|
332
|
+
name: `comment.block.documentation.mira`,
|
|
320
333
|
begin: String.raw `/\*\*`,
|
|
321
334
|
end: String.raw `\*/`,
|
|
322
335
|
},
|
|
323
|
-
{ name: `comment.block
|
|
336
|
+
{ name: `comment.block.mira`, begin: String.raw `/\*`, end: String.raw `\*/` },
|
|
324
337
|
],
|
|
325
338
|
},
|
|
326
339
|
...documentationRepository(),
|
|
327
340
|
'format-content': {
|
|
328
341
|
patterns: [
|
|
329
|
-
{ name: `constant.character.escape.format
|
|
342
|
+
{ name: `constant.character.escape.format.mira`, match: String.raw `\\.` },
|
|
330
343
|
{
|
|
331
344
|
begin: String.raw `\[`,
|
|
332
345
|
end: String.raw `\]`,
|
|
333
|
-
name: `string.unquoted.format.character-class
|
|
334
|
-
patterns: [{ name: `constant.character.escape.format
|
|
346
|
+
name: `string.unquoted.format.character-class.mira`,
|
|
347
|
+
patterns: [{ name: `constant.character.escape.format.mira`, match: String.raw `\\.` }],
|
|
335
348
|
},
|
|
336
349
|
{
|
|
337
350
|
begin: String.raw `\(`,
|
|
338
351
|
end: String.raw `\)`,
|
|
339
|
-
name: `string.unquoted.format.group
|
|
352
|
+
name: `string.unquoted.format.group.mira`,
|
|
340
353
|
patterns: [{ include: '#format-content' }],
|
|
341
354
|
},
|
|
342
355
|
],
|
|
@@ -345,34 +358,34 @@ function sourceRepository() {
|
|
|
345
358
|
'function-declarations': {
|
|
346
359
|
patterns: [
|
|
347
360
|
{
|
|
348
|
-
name: `meta.function.declaration
|
|
361
|
+
name: `meta.function.declaration.mira`,
|
|
349
362
|
begin: String.raw `${IDENTIFIER_START}(fn)(\s+)(${IDENTIFIER})(\s*)(\()`,
|
|
350
363
|
beginCaptures: {
|
|
351
|
-
1: { name: `keyword.declaration.function
|
|
352
|
-
3: { name: `entity.name.function
|
|
353
|
-
5: { name: `punctuation.section.parameters.begin
|
|
364
|
+
1: { name: `keyword.declaration.function.mira` },
|
|
365
|
+
3: { name: `entity.name.function.mira` },
|
|
366
|
+
5: { name: `punctuation.section.parameters.begin.mira` },
|
|
354
367
|
},
|
|
355
368
|
end: String.raw `\)`,
|
|
356
|
-
endCaptures: { 0: { name: `punctuation.section.parameters.end
|
|
369
|
+
endCaptures: { 0: { name: `punctuation.section.parameters.end.mira` } },
|
|
357
370
|
patterns: [{ include: '#parameters' }],
|
|
358
371
|
},
|
|
359
372
|
{
|
|
360
|
-
name: `meta.function.declaration
|
|
373
|
+
name: `meta.function.declaration.mira`,
|
|
361
374
|
match: String.raw `${IDENTIFIER_START}(fn)(\s+)(${IDENTIFIER})`,
|
|
362
375
|
captures: {
|
|
363
|
-
1: { name: `keyword.declaration.function
|
|
364
|
-
3: { name: `entity.name.function
|
|
376
|
+
1: { name: `keyword.declaration.function.mira` },
|
|
377
|
+
3: { name: `entity.name.function.mira` },
|
|
365
378
|
},
|
|
366
379
|
},
|
|
367
380
|
{
|
|
368
|
-
name: `meta.function.expression.parameters
|
|
381
|
+
name: `meta.function.expression.parameters.mira`,
|
|
369
382
|
begin: String.raw `${IDENTIFIER_START}(fn)(\s*)(\()`,
|
|
370
383
|
beginCaptures: {
|
|
371
|
-
1: { name: `keyword.declaration.function
|
|
372
|
-
3: { name: `punctuation.section.parameters.begin
|
|
384
|
+
1: { name: `keyword.declaration.function.mira` },
|
|
385
|
+
3: { name: `punctuation.section.parameters.begin.mira` },
|
|
373
386
|
},
|
|
374
387
|
end: String.raw `\)`,
|
|
375
|
-
endCaptures: { 0: { name: `punctuation.section.parameters.end
|
|
388
|
+
endCaptures: { 0: { name: `punctuation.section.parameters.end.mira` } },
|
|
376
389
|
patterns: [{ include: '#parameters' }],
|
|
377
390
|
},
|
|
378
391
|
],
|
|
@@ -382,17 +395,17 @@ function sourceRepository() {
|
|
|
382
395
|
{
|
|
383
396
|
match: String.raw `${IDENTIFIER_START}(mut)(\s+)(${IDENTIFIER})`,
|
|
384
397
|
captures: {
|
|
385
|
-
1: { name: `keyword.declaration.mutable
|
|
386
|
-
3: { name: `variable.emphasis
|
|
398
|
+
1: { name: `keyword.declaration.mutable.mira` },
|
|
399
|
+
3: { name: `variable.emphasis.mira` },
|
|
387
400
|
},
|
|
388
401
|
},
|
|
389
402
|
{
|
|
390
|
-
name: `keyword.declaration.mutable
|
|
403
|
+
name: `keyword.declaration.mutable.mira`,
|
|
391
404
|
match: `${IDENTIFIER_START}mut${IDENTIFIER_END}`,
|
|
392
405
|
},
|
|
393
|
-
{ name: `keyword.operator.spread
|
|
394
|
-
{ name: `variable.other.constant.emphasis
|
|
395
|
-
{ name: `punctuation.separator.parameter
|
|
406
|
+
{ name: `keyword.operator.spread.mira`, match: String.raw `\.\.` },
|
|
407
|
+
{ name: `variable.other.constant.emphasis.mira`, match: IDENTIFIER },
|
|
408
|
+
{ name: `punctuation.separator.parameter.mira`, match: ',' },
|
|
396
409
|
{
|
|
397
410
|
begin: String.raw `\(`,
|
|
398
411
|
end: String.raw `\)`,
|
|
@@ -411,8 +424,8 @@ function sourceRepository() {
|
|
|
411
424
|
{
|
|
412
425
|
match: String.raw `${IDENTIFIER_START}(mod)(\s+)(${IDENTIFIER})`,
|
|
413
426
|
captures: {
|
|
414
|
-
1: { name: `keyword.control.module
|
|
415
|
-
3: { name: `entity.name.namespace
|
|
427
|
+
1: { name: `keyword.control.module.mira` },
|
|
428
|
+
3: { name: `entity.name.namespace.mira` },
|
|
416
429
|
},
|
|
417
430
|
},
|
|
418
431
|
],
|
|
@@ -422,18 +435,18 @@ function sourceRepository() {
|
|
|
422
435
|
{
|
|
423
436
|
match: String.raw `${IDENTIFIER_START}(for)(\s+)(mut)(\s+)(${IDENTIFIER})(\s+)(in)${IDENTIFIER_END}`,
|
|
424
437
|
captures: {
|
|
425
|
-
1: { name: `keyword.control.loop
|
|
426
|
-
3: { name: `keyword.declaration.mutable
|
|
427
|
-
5: { name: `variable.other.readwrite
|
|
428
|
-
7: { name: `keyword.control.loop
|
|
438
|
+
1: { name: `keyword.control.loop.mira` },
|
|
439
|
+
3: { name: `keyword.declaration.mutable.mira` },
|
|
440
|
+
5: { name: `variable.other.readwrite.mira` },
|
|
441
|
+
7: { name: `keyword.control.loop.mira` },
|
|
429
442
|
},
|
|
430
443
|
},
|
|
431
444
|
{
|
|
432
445
|
match: String.raw `${IDENTIFIER_START}(for)(\s+)(${IDENTIFIER})(\s+)(in)${IDENTIFIER_END}`,
|
|
433
446
|
captures: {
|
|
434
|
-
1: { name: `keyword.control.loop
|
|
435
|
-
3: { name: `variable.other
|
|
436
|
-
5: { name: `keyword.control.loop
|
|
447
|
+
1: { name: `keyword.control.loop.mira` },
|
|
448
|
+
3: { name: `variable.other.mira` },
|
|
449
|
+
5: { name: `keyword.control.loop.mira` },
|
|
437
450
|
},
|
|
438
451
|
},
|
|
439
452
|
],
|
|
@@ -443,8 +456,8 @@ function sourceRepository() {
|
|
|
443
456
|
{
|
|
444
457
|
match: String.raw `(${IDENTIFIER})(\s*)(\??:)(?!:)`,
|
|
445
458
|
captures: {
|
|
446
|
-
1: { name: `variable.other.property
|
|
447
|
-
3: { name: `punctuation.separator.key-value
|
|
459
|
+
1: { name: `variable.other.property.mira` },
|
|
460
|
+
3: { name: `punctuation.separator.key-value.mira` },
|
|
448
461
|
},
|
|
449
462
|
},
|
|
450
463
|
],
|
|
@@ -454,23 +467,23 @@ function sourceRepository() {
|
|
|
454
467
|
{
|
|
455
468
|
match: String.raw `(\.)(\s*)(\d+)`,
|
|
456
469
|
captures: {
|
|
457
|
-
1: { name: `punctuation.accessor
|
|
458
|
-
3: { name: `variable.other.property
|
|
470
|
+
1: { name: `punctuation.accessor.mira` },
|
|
471
|
+
3: { name: `variable.other.property.mira` },
|
|
459
472
|
},
|
|
460
473
|
},
|
|
461
474
|
{
|
|
462
475
|
match: `(\\.)(\\s*)(${IDENTIFIER})(\\s*)(!?)(?=\\s*(?:\\(|@*["'\`]))`,
|
|
463
476
|
captures: {
|
|
464
|
-
1: { name: `punctuation.accessor
|
|
465
|
-
3: { name: `entity.name.function.member
|
|
466
|
-
5: { name: `keyword.operator.non-null
|
|
477
|
+
1: { name: `punctuation.accessor.mira` },
|
|
478
|
+
3: { name: `entity.name.function.member.mira` },
|
|
479
|
+
5: { name: `keyword.operator.non-null.mira` },
|
|
467
480
|
},
|
|
468
481
|
},
|
|
469
482
|
{
|
|
470
483
|
match: String.raw `(\.)(\s*)(${IDENTIFIER})`,
|
|
471
484
|
captures: {
|
|
472
|
-
1: { name: `punctuation.accessor
|
|
473
|
-
3: { name: `variable.other.property
|
|
485
|
+
1: { name: `punctuation.accessor.mira` },
|
|
486
|
+
3: { name: `variable.other.property.mira` },
|
|
474
487
|
},
|
|
475
488
|
},
|
|
476
489
|
],
|
|
@@ -480,8 +493,8 @@ function sourceRepository() {
|
|
|
480
493
|
{
|
|
481
494
|
match: `(${IDENTIFIER})(\\s*)(!?)(?=\\s*(?:\\(|@*["'\`]))`,
|
|
482
495
|
captures: {
|
|
483
|
-
1: { name: `entity.name.function
|
|
484
|
-
3: { name: `keyword.operator.non-null
|
|
496
|
+
1: { name: `entity.name.function.mira` },
|
|
497
|
+
3: { name: `keyword.operator.non-null.mira` },
|
|
485
498
|
},
|
|
486
499
|
},
|
|
487
500
|
],
|
|
@@ -489,7 +502,7 @@ function sourceRepository() {
|
|
|
489
502
|
'type-keyword': {
|
|
490
503
|
patterns: [
|
|
491
504
|
{
|
|
492
|
-
name: `keyword.operator.expression
|
|
505
|
+
name: `keyword.operator.expression.mira`,
|
|
493
506
|
match: String.raw `${IDENTIFIER_START}type${IDENTIFIER_END}(?=\s*\(|\s+${IDENTIFIER})`,
|
|
494
507
|
},
|
|
495
508
|
],
|
|
@@ -497,23 +510,23 @@ function sourceRepository() {
|
|
|
497
510
|
numbers: {
|
|
498
511
|
patterns: [
|
|
499
512
|
{
|
|
500
|
-
name: `constant.numeric.hex
|
|
513
|
+
name: `constant.numeric.hex.mira`,
|
|
501
514
|
match: `0[xX][0-9A-Fa-f](?:[0-9A-Fa-f_]*[0-9A-Fa-f])?${IDENTIFIER_END}`,
|
|
502
515
|
},
|
|
503
516
|
{
|
|
504
|
-
name: `constant.numeric.octal
|
|
517
|
+
name: `constant.numeric.octal.mira`,
|
|
505
518
|
match: `0[oO][0-7](?:[0-7_]*[0-7])?${IDENTIFIER_END}`,
|
|
506
519
|
},
|
|
507
520
|
{
|
|
508
|
-
name: `constant.numeric.binary
|
|
521
|
+
name: `constant.numeric.binary.mira`,
|
|
509
522
|
match: `0[bB][01](?:[01_]*[01])?${IDENTIFIER_END}`,
|
|
510
523
|
},
|
|
511
524
|
{
|
|
512
|
-
name: `invalid.illegal.numeric
|
|
525
|
+
name: `invalid.illegal.numeric.mira`,
|
|
513
526
|
match: String.raw `0[xXoObB]\p{XID_Continue}*`,
|
|
514
527
|
},
|
|
515
528
|
{
|
|
516
|
-
name: `constant.numeric.float
|
|
529
|
+
name: `constant.numeric.float.mira`,
|
|
517
530
|
match: String.raw `\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?[\d_]*\d)?${IDENTIFIER_END}`,
|
|
518
531
|
},
|
|
519
532
|
],
|
|
@@ -521,49 +534,49 @@ function sourceRepository() {
|
|
|
521
534
|
keywords: { patterns: keywordPatterns },
|
|
522
535
|
identifiers: {
|
|
523
536
|
patterns: [
|
|
524
|
-
{ name: `variable.other.constant
|
|
525
|
-
{ name: `variable.other
|
|
537
|
+
{ name: `variable.other.constant.mira`, match: String.raw `@+\p{XID_Continue}+` },
|
|
538
|
+
{ name: `variable.other.mira`, match: IDENTIFIER },
|
|
526
539
|
],
|
|
527
540
|
},
|
|
528
541
|
operators: {
|
|
529
542
|
patterns: [
|
|
530
|
-
{ name: `keyword.operator.spread
|
|
531
|
-
{ name: `keyword.operator.bind
|
|
532
|
-
{ name: `keyword.operator.conditional
|
|
543
|
+
{ name: `keyword.operator.spread.mira`, match: String.raw `\.\.<|\.\.` },
|
|
544
|
+
{ name: `keyword.operator.bind.mira`, match: '::' },
|
|
545
|
+
{ name: `keyword.operator.conditional.mira`, match: String.raw `\?:` },
|
|
533
546
|
{
|
|
534
|
-
name: `keyword.operator.assignment
|
|
547
|
+
name: `keyword.operator.assignment.mira`,
|
|
535
548
|
match: String.raw `&&=|\|\|=|\?\?=|\+=|-=|\*=|/=|%=|\^=|=`,
|
|
536
549
|
},
|
|
537
550
|
{
|
|
538
|
-
name: `keyword.operator.comparison
|
|
551
|
+
name: `keyword.operator.comparison.mira`,
|
|
539
552
|
match: '===|!==|>=|<=|==|!=|=~|!~|>|<',
|
|
540
553
|
},
|
|
541
|
-
{ name: `keyword.operator.logical
|
|
542
|
-
{ name: `keyword.operator.arithmetic
|
|
554
|
+
{ name: `keyword.operator.logical.mira`, match: String.raw `&&|\|\||\?\?|!` },
|
|
555
|
+
{ name: `keyword.operator.arithmetic.mira`, match: String.raw `\+|-|\*|/|%|\^` },
|
|
543
556
|
],
|
|
544
557
|
},
|
|
545
558
|
punctuation: {
|
|
546
559
|
patterns: [
|
|
547
|
-
{ name: `punctuation.section.braces
|
|
548
|
-
{ name: `punctuation.section.brackets
|
|
549
|
-
{ name: `punctuation.section.parens
|
|
550
|
-
{ name: `punctuation.separator
|
|
551
|
-
{ name: `punctuation.accessor
|
|
560
|
+
{ name: `punctuation.section.braces.mira`, match: '[{}]' },
|
|
561
|
+
{ name: `punctuation.section.brackets.mira`, match: String.raw `[\[\]]` },
|
|
562
|
+
{ name: `punctuation.section.parens.mira`, match: '[()]' },
|
|
563
|
+
{ name: `punctuation.separator.mira`, match: '[,;:]' },
|
|
564
|
+
{ name: `punctuation.accessor.mira`, match: String.raw `\.` },
|
|
552
565
|
],
|
|
553
566
|
},
|
|
554
567
|
'braced-content': {
|
|
555
568
|
patterns: [
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
569
|
+
delimitedContent('braces', String.raw `\{`, String.raw `\}`, '#braced-content'),
|
|
570
|
+
delimitedContent('parens', String.raw `\(`, String.raw `\)`, '#parenthesized-content'),
|
|
571
|
+
delimitedContent('brackets', String.raw `\[`, String.raw `\]`, '#bracketed-content'),
|
|
559
572
|
{ include: '#source' },
|
|
560
573
|
],
|
|
561
574
|
},
|
|
562
575
|
'interpolation-expression-content': {
|
|
563
576
|
patterns: [
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
577
|
+
delimitedContent('parens', String.raw `\(`, String.raw `\)`, '#parenthesized-content'),
|
|
578
|
+
delimitedContent('braces', String.raw `\{`, String.raw `\}`, '#braced-content'),
|
|
579
|
+
delimitedContent('brackets', String.raw `\[`, String.raw `\]`, '#bracketed-content'),
|
|
567
580
|
{ include: '#comments' },
|
|
568
581
|
{ include: '#strings' },
|
|
569
582
|
{ include: '#function-declarations' },
|
|
@@ -581,17 +594,17 @@ function sourceRepository() {
|
|
|
581
594
|
},
|
|
582
595
|
'parenthesized-content': {
|
|
583
596
|
patterns: [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
597
|
+
delimitedContent('parens', String.raw `\(`, String.raw `\)`, '#parenthesized-content'),
|
|
598
|
+
delimitedContent('braces', String.raw `\{`, String.raw `\}`, '#braced-content'),
|
|
599
|
+
delimitedContent('brackets', String.raw `\[`, String.raw `\]`, '#bracketed-content'),
|
|
587
600
|
{ include: '#source' },
|
|
588
601
|
],
|
|
589
602
|
},
|
|
590
603
|
'bracketed-content': {
|
|
591
604
|
patterns: [
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
605
|
+
delimitedContent('brackets', String.raw `\[`, String.raw `\]`, '#bracketed-content'),
|
|
606
|
+
delimitedContent('braces', String.raw `\{`, String.raw `\}`, '#braced-content'),
|
|
607
|
+
delimitedContent('parens', String.raw `\(`, String.raw `\)`, '#parenthesized-content'),
|
|
595
608
|
{ include: '#source' },
|
|
596
609
|
],
|
|
597
610
|
},
|