@mirascript/textmate 0.1.81

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.
@@ -0,0 +1,690 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "mirascript-doc",
4
+ "scopeName": "source.mira.doc",
5
+ "patterns": [
6
+ {
7
+ "include": "#doc"
8
+ }
9
+ ],
10
+ "repository": {
11
+ "doc": {
12
+ "patterns": [
13
+ {
14
+ "include": "#global-value"
15
+ },
16
+ {
17
+ "include": "#global-constants"
18
+ },
19
+ {
20
+ "include": "#inline-parameter"
21
+ },
22
+ {
23
+ "include": "#inline-label"
24
+ },
25
+ {
26
+ "include": "#bindings"
27
+ },
28
+ {
29
+ "include": "#function-signatures"
30
+ },
31
+ {
32
+ "include": "#properties"
33
+ },
34
+ {
35
+ "include": "#generic-types"
36
+ },
37
+ {
38
+ "include": "#parameters"
39
+ },
40
+ {
41
+ "include": "#return-type"
42
+ },
43
+ {
44
+ "include": "#metadata"
45
+ },
46
+ {
47
+ "include": "source.mira"
48
+ }
49
+ ]
50
+ },
51
+ "global-value": {
52
+ "patterns": [
53
+ {
54
+ "begin": "^(\\x00)?(\\(global\\))(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(=)",
55
+ "beginCaptures": {
56
+ "2": {
57
+ "name": "entity.name.label.mira"
58
+ },
59
+ "4": {
60
+ "name": "variable.other.constant.mira"
61
+ },
62
+ "6": {
63
+ "name": "keyword.operator.assignment.mira"
64
+ }
65
+ },
66
+ "end": "$",
67
+ "patterns": [
68
+ {
69
+ "include": "#doc-value"
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ },
75
+ "global-constants": {
76
+ "patterns": [
77
+ {
78
+ "match": "^(\\x00)?(\\(global\\))(\\s+)((?:@+\\p{XID_Continue}+|\\p{Lu}[\\p{XID_Continue}]*))(?=\\s*(?:=|;|$))",
79
+ "captures": {
80
+ "2": {
81
+ "name": "entity.name.label.mira"
82
+ },
83
+ "4": {
84
+ "name": "variable.other.constant.mira"
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "match": "^(\\x00)?((?:@+\\p{XID_Continue}+|\\p{Lu}[\\p{XID_Continue}]*))(?=\\s*(?:=|;|$))",
90
+ "captures": {
91
+ "2": {
92
+ "name": "variable.other.constant.mira"
93
+ }
94
+ }
95
+ }
96
+ ]
97
+ },
98
+ "inline-parameter": {
99
+ "patterns": [
100
+ {
101
+ "match": "^(\\x00)?(\\(parameter(?:\\s+pattern)?\\))(\\s+)(\\.\\.)?(mut)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)",
102
+ "captures": {
103
+ "2": {
104
+ "name": "entity.name.label.mira"
105
+ },
106
+ "4": {
107
+ "name": "keyword.operator.spread.mira"
108
+ },
109
+ "5": {
110
+ "name": "keyword.declaration.mutable.mira"
111
+ },
112
+ "7": {
113
+ "name": "variable.emphasis.mira"
114
+ }
115
+ }
116
+ },
117
+ {
118
+ "match": "^(\\x00)?(\\(parameter(?:\\s+pattern)?\\))(\\s+)(\\.\\.)?(\\s*)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)",
119
+ "captures": {
120
+ "2": {
121
+ "name": "entity.name.label.mira"
122
+ },
123
+ "4": {
124
+ "name": "keyword.operator.spread.mira"
125
+ },
126
+ "6": {
127
+ "name": "variable.other.constant.emphasis.mira"
128
+ }
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ "inline-label": {
134
+ "patterns": [
135
+ {
136
+ "match": "^(\\x00)?(\\([^():,\\[\\]<>|&\\r\\n]+\\))(?=\\s+\\S)",
137
+ "captures": {
138
+ "2": {
139
+ "name": "entity.name.label.mira"
140
+ }
141
+ }
142
+ }
143
+ ]
144
+ },
145
+ "bindings": {
146
+ "patterns": [
147
+ {
148
+ "match": "(?<!\\p{XID_Continue})(let)(\\s+)(mut)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)",
149
+ "captures": {
150
+ "1": {
151
+ "name": "keyword.declaration.variable.mira"
152
+ },
153
+ "3": {
154
+ "name": "keyword.declaration.mutable.mira"
155
+ },
156
+ "5": {
157
+ "name": "variable.other.readwrite.mira"
158
+ }
159
+ }
160
+ },
161
+ {
162
+ "match": "(?<!\\p{XID_Continue})(let|const)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)",
163
+ "captures": {
164
+ "1": {
165
+ "name": "keyword.declaration.variable.mira"
166
+ },
167
+ "3": {
168
+ "name": "variable.other.constant.mira"
169
+ }
170
+ }
171
+ }
172
+ ]
173
+ },
174
+ "function-signatures": {
175
+ "patterns": [
176
+ {
177
+ "match": "(?<!\\p{XID_Continue})(?:(pub)(\\s+))?(fn)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(?=\\s*(?:<|\\())",
178
+ "captures": {
179
+ "1": {
180
+ "name": "keyword.control.module.mira"
181
+ },
182
+ "3": {
183
+ "name": "keyword.declaration.function.mira"
184
+ },
185
+ "5": {
186
+ "name": "entity.name.function.mira"
187
+ }
188
+ }
189
+ }
190
+ ]
191
+ },
192
+ "properties": {
193
+ "patterns": [
194
+ {
195
+ "begin": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\??:)",
196
+ "beginCaptures": {
197
+ "1": {
198
+ "name": "variable.other.property.mira"
199
+ },
200
+ "3": {
201
+ "name": "punctuation.separator.type.mira"
202
+ }
203
+ },
204
+ "end": "$",
205
+ "patterns": [
206
+ {
207
+ "include": "#metadata"
208
+ },
209
+ {
210
+ "include": "#type-context"
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ },
216
+ "doc-value": {
217
+ "patterns": [
218
+ {
219
+ "include": "#extern-function-properties"
220
+ },
221
+ {
222
+ "include": "#extern-class-properties"
223
+ },
224
+ {
225
+ "include": "#metadata"
226
+ },
227
+ {
228
+ "include": "#doc-record-value"
229
+ },
230
+ {
231
+ "include": "source.mira"
232
+ }
233
+ ]
234
+ },
235
+ "doc-record-value": {
236
+ "patterns": [
237
+ {
238
+ "begin": "\\(",
239
+ "beginCaptures": {
240
+ "0": {
241
+ "name": "punctuation.section.parens.begin.mira"
242
+ }
243
+ },
244
+ "end": "\\)",
245
+ "endCaptures": {
246
+ "0": {
247
+ "name": "punctuation.section.parens.end.mira"
248
+ }
249
+ },
250
+ "patterns": [
251
+ {
252
+ "include": "#doc-value"
253
+ }
254
+ ]
255
+ }
256
+ ]
257
+ },
258
+ "extern-function-properties": {
259
+ "patterns": [
260
+ {
261
+ "match": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(:)(?=\\s*/\\*\\s*<\\s*extern\\s+(?:(?:async\\s+)?function\\*?)(?:\\s+(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)?\\s*>\\s*\\*/)",
262
+ "captures": {
263
+ "1": {
264
+ "name": "entity.name.function.mira"
265
+ },
266
+ "3": {
267
+ "name": "punctuation.separator.key-value.mira"
268
+ }
269
+ }
270
+ }
271
+ ]
272
+ },
273
+ "extern-class-properties": {
274
+ "patterns": [
275
+ {
276
+ "match": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(:)(?=\\s*/\\*\\s*<\\s*extern\\s+class(?:\\s+(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)?\\s*>\\s*\\*/)",
277
+ "captures": {
278
+ "1": {
279
+ "name": "entity.name.type.mira"
280
+ },
281
+ "3": {
282
+ "name": "punctuation.separator.key-value.mira"
283
+ }
284
+ }
285
+ }
286
+ ]
287
+ },
288
+ "metadata": {
289
+ "patterns": [
290
+ {
291
+ "name": "comment.block.mira",
292
+ "contentName": "meta.documentation.type-hint.mira",
293
+ "begin": "/\\*\\s*<",
294
+ "beginCaptures": {
295
+ "0": {
296
+ "name": "punctuation.definition.comment.begin.mira"
297
+ }
298
+ },
299
+ "end": ">\\s*\\*/",
300
+ "endCaptures": {
301
+ "0": {
302
+ "name": "punctuation.definition.comment.end.mira"
303
+ }
304
+ },
305
+ "patterns": [
306
+ {
307
+ "match": "(?<!\\p{XID_Continue})(extern)(\\s+)(?:(async)(\\s+))?(function)(\\*)?(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
308
+ "captures": {
309
+ "1": {
310
+ "name": "storage.modifier.extern.mira"
311
+ },
312
+ "3": {
313
+ "name": "storage.modifier.async.mira"
314
+ },
315
+ "5": {
316
+ "name": "keyword.declaration.function.mira"
317
+ },
318
+ "6": {
319
+ "name": "keyword.operator.generator.mira"
320
+ },
321
+ "7": {
322
+ "name": "entity.name.function.mira"
323
+ }
324
+ }
325
+ },
326
+ {
327
+ "match": "(?<!\\p{XID_Continue})(extern)(\\s+)(class)(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
328
+ "captures": {
329
+ "1": {
330
+ "name": "storage.modifier.extern.mira"
331
+ },
332
+ "3": {
333
+ "name": "keyword.declaration.class.mira"
334
+ },
335
+ "4": {
336
+ "name": "entity.name.type.mira"
337
+ }
338
+ }
339
+ },
340
+ {
341
+ "match": "(?<!\\p{XID_Continue})(extern)(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
342
+ "captures": {
343
+ "1": {
344
+ "name": "storage.modifier.extern.mira"
345
+ },
346
+ "2": {
347
+ "name": "entity.name.type.mira"
348
+ }
349
+ }
350
+ },
351
+ {
352
+ "name": "entity.name.type.mira",
353
+ "match": "(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*"
354
+ },
355
+ {
356
+ "name": "constant.numeric.mira",
357
+ "match": "\\d+"
358
+ },
359
+ {
360
+ "name": "punctuation.separator.type.mira",
361
+ "match": "[().,<>]"
362
+ }
363
+ ]
364
+ }
365
+ ]
366
+ },
367
+ "reflection-type": {
368
+ "patterns": [
369
+ {
370
+ "match": "(?<!\\p{XID_Continue})(type)(\\s*)(\\()(\\s*)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\))",
371
+ "captures": {
372
+ "1": {
373
+ "name": "keyword.operator.expression.mira"
374
+ },
375
+ "3": {
376
+ "name": "punctuation.section.parens.begin.mira"
377
+ },
378
+ "5": {
379
+ "name": "variable.other.mira"
380
+ },
381
+ "7": {
382
+ "name": "punctuation.section.parens.end.mira"
383
+ }
384
+ }
385
+ }
386
+ ]
387
+ },
388
+ "type-context": {
389
+ "patterns": [
390
+ {
391
+ "include": "#reflection-type"
392
+ },
393
+ {
394
+ "include": "#function-type"
395
+ },
396
+ {
397
+ "include": "#generic-types"
398
+ },
399
+ {
400
+ "include": "#type-grouping"
401
+ },
402
+ {
403
+ "include": "#type-brackets"
404
+ },
405
+ {
406
+ "include": "#type-atoms"
407
+ }
408
+ ]
409
+ },
410
+ "function-type": {
411
+ "patterns": [
412
+ {
413
+ "begin": "(?<!\\p{XID_Continue})(fn)(?!\\p{XID_Continue})(?=\\s*(?:<|\\())",
414
+ "beginCaptures": {
415
+ "1": {
416
+ "name": "support.type.function.mira"
417
+ }
418
+ },
419
+ "end": "(?=\\s*(?:,|\\)|$))",
420
+ "patterns": [
421
+ {
422
+ "include": "#generic-types"
423
+ },
424
+ {
425
+ "include": "#parameters"
426
+ },
427
+ {
428
+ "include": "#return-type"
429
+ },
430
+ {
431
+ "include": "#type-context"
432
+ }
433
+ ]
434
+ }
435
+ ]
436
+ },
437
+ "generic-types": {
438
+ "patterns": [
439
+ {
440
+ "begin": "<",
441
+ "beginCaptures": {
442
+ "0": {
443
+ "name": "punctuation.definition.type-parameters.begin.mira"
444
+ }
445
+ },
446
+ "end": ">",
447
+ "endCaptures": {
448
+ "0": {
449
+ "name": "punctuation.definition.type-parameters.end.mira"
450
+ }
451
+ },
452
+ "patterns": [
453
+ {
454
+ "include": "#reflection-type"
455
+ },
456
+ {
457
+ "include": "#function-type"
458
+ },
459
+ {
460
+ "include": "#generic-types"
461
+ },
462
+ {
463
+ "include": "#type-grouping"
464
+ },
465
+ {
466
+ "include": "#type-brackets"
467
+ },
468
+ {
469
+ "include": "#type-atoms"
470
+ }
471
+ ]
472
+ }
473
+ ]
474
+ },
475
+ "parameters": {
476
+ "patterns": [
477
+ {
478
+ "begin": "\\(",
479
+ "beginCaptures": {
480
+ "0": {
481
+ "name": "punctuation.section.parameters.begin.mira"
482
+ }
483
+ },
484
+ "end": "\\)",
485
+ "endCaptures": {
486
+ "0": {
487
+ "name": "punctuation.section.parameters.end.mira"
488
+ }
489
+ },
490
+ "patterns": [
491
+ {
492
+ "begin": "(\\.\\.)?(\\s*)(mut)?(\\s*)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\??:)(?=\\s*fn(?!\\p{XID_Continue}))",
493
+ "beginCaptures": {
494
+ "1": {
495
+ "name": "keyword.operator.spread.mira"
496
+ },
497
+ "3": {
498
+ "name": "keyword.declaration.mutable.mira"
499
+ },
500
+ "5": {
501
+ "name": "entity.name.function.emphasis.mira"
502
+ },
503
+ "7": {
504
+ "name": "punctuation.separator.type.mira"
505
+ }
506
+ },
507
+ "end": "(?=,|\\))",
508
+ "patterns": [
509
+ {
510
+ "include": "#type-context"
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ "begin": "(\\.\\.)?(\\s*)(mut)?(\\s*)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\??:)",
516
+ "beginCaptures": {
517
+ "1": {
518
+ "name": "keyword.operator.spread.mira"
519
+ },
520
+ "3": {
521
+ "name": "keyword.declaration.mutable.mira"
522
+ },
523
+ "5": {
524
+ "name": "variable.other.constant.emphasis.mira"
525
+ },
526
+ "7": {
527
+ "name": "punctuation.separator.type.mira"
528
+ }
529
+ },
530
+ "end": "(?=,|\\))",
531
+ "patterns": [
532
+ {
533
+ "include": "#type-context"
534
+ }
535
+ ]
536
+ },
537
+ {
538
+ "match": "(\\.\\.)?(\\s*)(mut)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)",
539
+ "captures": {
540
+ "1": {
541
+ "name": "keyword.operator.spread.mira"
542
+ },
543
+ "3": {
544
+ "name": "keyword.declaration.mutable.mira"
545
+ },
546
+ "5": {
547
+ "name": "variable.emphasis.mira"
548
+ }
549
+ }
550
+ },
551
+ {
552
+ "name": "keyword.operator.spread.mira",
553
+ "match": "\\.\\."
554
+ },
555
+ {
556
+ "name": "variable.other.constant.emphasis.mira",
557
+ "match": "(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*"
558
+ },
559
+ {
560
+ "name": "punctuation.separator.parameter.mira",
561
+ "match": ","
562
+ }
563
+ ]
564
+ }
565
+ ]
566
+ },
567
+ "type-grouping": {
568
+ "patterns": [
569
+ {
570
+ "begin": "\\(",
571
+ "beginCaptures": {
572
+ "0": {
573
+ "name": "punctuation.section.parens.begin.mira"
574
+ }
575
+ },
576
+ "end": "\\)",
577
+ "endCaptures": {
578
+ "0": {
579
+ "name": "punctuation.section.parens.end.mira"
580
+ }
581
+ },
582
+ "patterns": [
583
+ {
584
+ "begin": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\??:)",
585
+ "beginCaptures": {
586
+ "1": {
587
+ "name": "variable.other.property.mira"
588
+ },
589
+ "3": {
590
+ "name": "punctuation.separator.type.mira"
591
+ }
592
+ },
593
+ "end": "(?=,|\\))",
594
+ "patterns": [
595
+ {
596
+ "include": "#type-context"
597
+ }
598
+ ]
599
+ },
600
+ {
601
+ "include": "#type-context"
602
+ }
603
+ ]
604
+ }
605
+ ]
606
+ },
607
+ "type-brackets": {
608
+ "patterns": [
609
+ {
610
+ "begin": "\\[",
611
+ "beginCaptures": {
612
+ "0": {
613
+ "name": "punctuation.section.brackets.begin.mira"
614
+ }
615
+ },
616
+ "end": "\\]",
617
+ "endCaptures": {
618
+ "0": {
619
+ "name": "punctuation.section.brackets.end.mira"
620
+ }
621
+ },
622
+ "patterns": [
623
+ {
624
+ "include": "#type-context"
625
+ }
626
+ ]
627
+ }
628
+ ]
629
+ },
630
+ "return-type": {
631
+ "patterns": [
632
+ {
633
+ "begin": "->",
634
+ "beginCaptures": {
635
+ "0": {
636
+ "name": "keyword.operator.type.mira"
637
+ }
638
+ },
639
+ "end": "(?=,|\\)|$)",
640
+ "patterns": [
641
+ {
642
+ "include": "#type-context"
643
+ }
644
+ ]
645
+ }
646
+ ]
647
+ },
648
+ "type-atoms": {
649
+ "patterns": [
650
+ {
651
+ "include": "#reflection-type"
652
+ },
653
+ {
654
+ "name": "support.type.builtin.mira",
655
+ "match": "(?<!\\p{XID_Continue})(?:unknown|boolean|number|string|record|extern|module|never|array|any|nil)(?!\\p{XID_Continue})"
656
+ },
657
+ {
658
+ "name": "constant.language.boolean.mira",
659
+ "match": "(?<!\\p{XID_Continue})(?:true|false)(?!\\p{XID_Continue})"
660
+ },
661
+ {
662
+ "name": "keyword.operator.type.mira",
663
+ "match": "[&|]"
664
+ },
665
+ {
666
+ "name": "keyword.operator.spread.mira",
667
+ "match": "\\.\\."
668
+ },
669
+ {
670
+ "name": "entity.name.type.mira",
671
+ "match": "(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*"
672
+ },
673
+ {
674
+ "name": "punctuation.section.brackets.mira",
675
+ "match": "[\\[\\]]"
676
+ },
677
+ {
678
+ "name": "punctuation.separator.type.mira",
679
+ "match": "[,.?:]"
680
+ },
681
+ {
682
+ "include": "source.mira#strings"
683
+ },
684
+ {
685
+ "include": "source.mira#numbers"
686
+ }
687
+ ]
688
+ }
689
+ }
690
+ }