@mirascript/textmate 0.1.83 → 0.1.85

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
2
+ "$schema": "https://www.schemastore.org/tmlanguage.json",
3
3
  "name": "mirascript-doc",
4
4
  "scopeName": "source.mira.doc",
5
5
  "patterns": [
@@ -182,6 +182,9 @@
182
182
  },
183
183
  "doc": {
184
184
  "patterns": [
185
+ {
186
+ "include": "#tag"
187
+ },
185
188
  {
186
189
  "include": "#global-value"
187
190
  },
@@ -191,17 +194,20 @@
191
194
  {
192
195
  "include": "#inline-parameter"
193
196
  },
197
+ {
198
+ "include": "#properties"
199
+ },
194
200
  {
195
201
  "include": "#inline-label"
196
202
  },
197
203
  {
198
- "include": "#bindings"
204
+ "include": "#binding-value"
199
205
  },
200
206
  {
201
- "include": "#function-signatures"
207
+ "include": "#bindings"
202
208
  },
203
209
  {
204
- "include": "#properties"
210
+ "include": "#function-signatures"
205
211
  },
206
212
  {
207
213
  "include": "#generic-types"
@@ -213,23 +219,49 @@
213
219
  "include": "#return-type"
214
220
  },
215
221
  {
216
- "include": "#metadata"
222
+ "include": "#tag-comment"
217
223
  },
218
224
  {
219
225
  "include": "source.mira"
220
226
  }
221
227
  ]
222
228
  },
229
+ "tag": {
230
+ "patterns": [
231
+ {
232
+ "name": "meta.documentation.tag.mira",
233
+ "contentName": "meta.documentation.tag.content.mira",
234
+ "begin": "(<)(?=(?:module|function|extern)(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>)",
235
+ "beginCaptures": {
236
+ "1": {
237
+ "name": "punctuation.definition.tag.begin.mira"
238
+ }
239
+ },
240
+ "end": "(>)",
241
+ "endCaptures": {
242
+ "1": {
243
+ "name": "punctuation.definition.tag.end.mira"
244
+ }
245
+ },
246
+ "patterns": [
247
+ {
248
+ "include": "#tag-content"
249
+ }
250
+ ]
251
+ }
252
+ ]
253
+ },
223
254
  "global-value": {
224
255
  "patterns": [
225
256
  {
257
+ "name": "meta.documentation.global-value.mira",
226
258
  "begin": "^(\\x00)?(\\(global\\))(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(=)",
227
259
  "beginCaptures": {
228
260
  "2": {
229
261
  "name": "entity.name.label.mira"
230
262
  },
231
263
  "4": {
232
- "name": "variable.other.constant.mira"
264
+ "name": "variable.other.mira"
233
265
  },
234
266
  "6": {
235
267
  "name": "keyword.operator.assignment.mira"
@@ -343,6 +375,53 @@
343
375
  }
344
376
  ]
345
377
  },
378
+ "binding-value": {
379
+ "patterns": [
380
+ {
381
+ "begin": "(?<!\\p{XID_Continue})(let)(\\s+)(mut)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(=)",
382
+ "beginCaptures": {
383
+ "1": {
384
+ "name": "keyword.declaration.variable.mira"
385
+ },
386
+ "3": {
387
+ "name": "keyword.declaration.mutable.mira"
388
+ },
389
+ "5": {
390
+ "name": "variable.other.readwrite.mira"
391
+ },
392
+ "7": {
393
+ "name": "keyword.operator.assignment.mira"
394
+ }
395
+ },
396
+ "end": "$",
397
+ "patterns": [
398
+ {
399
+ "include": "#doc-value"
400
+ }
401
+ ]
402
+ },
403
+ {
404
+ "begin": "(?<!\\p{XID_Continue})(let|const)(\\s+)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(=)",
405
+ "beginCaptures": {
406
+ "1": {
407
+ "name": "keyword.declaration.variable.mira"
408
+ },
409
+ "3": {
410
+ "name": "variable.other.constant.mira"
411
+ },
412
+ "5": {
413
+ "name": "keyword.operator.assignment.mira"
414
+ }
415
+ },
416
+ "end": "$",
417
+ "patterns": [
418
+ {
419
+ "include": "#doc-value"
420
+ }
421
+ ]
422
+ }
423
+ ]
424
+ },
346
425
  "function-signatures": {
347
426
  "patterns": [
348
427
  {
@@ -364,19 +443,98 @@
364
443
  "properties": {
365
444
  "patterns": [
366
445
  {
367
- "begin": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\??:)",
446
+ "name": "meta.documentation.field.mira",
447
+ "begin": "^(\\x00)?(?:(\\(field\\))(\\s+))?((?:(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*|\\d+|\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|'(?:\\\\.|[^'\\\\\\r\\n])*'))(\\s*)(\\??:)(?=[ \\t]*/\\*[ \\t]*<extern[ \\t]+(?:(?:async[ \\t]+)?function\\*?)(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>[ \\t]*\\*/)",
368
448
  "beginCaptures": {
369
- "1": {
449
+ "2": {
450
+ "name": "entity.name.label.mira"
451
+ },
452
+ "4": {
453
+ "name": "entity.name.function.mira"
454
+ },
455
+ "6": {
456
+ "name": "punctuation.separator.type.mira"
457
+ }
458
+ },
459
+ "end": "$",
460
+ "patterns": [
461
+ {
462
+ "include": "#tag-comment"
463
+ },
464
+ {
465
+ "include": "#tag"
466
+ },
467
+ {
468
+ "include": "#doc-record-value"
469
+ },
470
+ {
471
+ "include": "#doc-array-value"
472
+ },
473
+ {
474
+ "include": "#type-context"
475
+ }
476
+ ]
477
+ },
478
+ {
479
+ "name": "meta.documentation.field.mira",
480
+ "begin": "^(\\x00)?(?:(\\(field\\))(\\s+))?((?:(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*|\\d+|\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|'(?:\\\\.|[^'\\\\\\r\\n])*'))(\\s*)(\\??:)(?=[ \\t]*/\\*[ \\t]*<extern[ \\t]+class(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>[ \\t]*\\*/)",
481
+ "beginCaptures": {
482
+ "2": {
483
+ "name": "entity.name.label.mira"
484
+ },
485
+ "4": {
486
+ "name": "entity.name.type.mira"
487
+ },
488
+ "6": {
489
+ "name": "punctuation.separator.type.mira"
490
+ }
491
+ },
492
+ "end": "$",
493
+ "patterns": [
494
+ {
495
+ "include": "#tag-comment"
496
+ },
497
+ {
498
+ "include": "#tag"
499
+ },
500
+ {
501
+ "include": "#doc-record-value"
502
+ },
503
+ {
504
+ "include": "#doc-array-value"
505
+ },
506
+ {
507
+ "include": "#type-context"
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ "name": "meta.documentation.field.mira",
513
+ "begin": "^(\\x00)?(?:(\\(field\\))(\\s+))?((?:(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*|\\d+|\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|'(?:\\\\.|[^'\\\\\\r\\n])*'))(\\s*)(\\??:)",
514
+ "beginCaptures": {
515
+ "2": {
516
+ "name": "entity.name.label.mira"
517
+ },
518
+ "4": {
370
519
  "name": "variable.other.property.mira"
371
520
  },
372
- "3": {
521
+ "6": {
373
522
  "name": "punctuation.separator.type.mira"
374
523
  }
375
524
  },
376
525
  "end": "$",
377
526
  "patterns": [
378
527
  {
379
- "include": "#metadata"
528
+ "include": "#tag-comment"
529
+ },
530
+ {
531
+ "include": "#tag"
532
+ },
533
+ {
534
+ "include": "#doc-record-value"
535
+ },
536
+ {
537
+ "include": "#doc-array-value"
380
538
  },
381
539
  {
382
540
  "include": "#type-context"
@@ -388,17 +546,20 @@
388
546
  "doc-value": {
389
547
  "patterns": [
390
548
  {
391
- "include": "#extern-function-properties"
549
+ "include": "#tag-properties"
392
550
  },
393
551
  {
394
- "include": "#extern-class-properties"
552
+ "include": "#tag-comment"
395
553
  },
396
554
  {
397
- "include": "#metadata"
555
+ "include": "#tag"
398
556
  },
399
557
  {
400
558
  "include": "#doc-record-value"
401
559
  },
560
+ {
561
+ "include": "#doc-array-value"
562
+ },
402
563
  {
403
564
  "include": "source.mira"
404
565
  }
@@ -427,10 +588,33 @@
427
588
  }
428
589
  ]
429
590
  },
430
- "extern-function-properties": {
591
+ "doc-array-value": {
592
+ "patterns": [
593
+ {
594
+ "begin": "\\[",
595
+ "beginCaptures": {
596
+ "0": {
597
+ "name": "punctuation.section.brackets.begin.mira"
598
+ }
599
+ },
600
+ "end": "\\]",
601
+ "endCaptures": {
602
+ "0": {
603
+ "name": "punctuation.section.brackets.end.mira"
604
+ }
605
+ },
606
+ "patterns": [
607
+ {
608
+ "include": "#doc-value"
609
+ }
610
+ ]
611
+ }
612
+ ]
613
+ },
614
+ "tag-properties": {
431
615
  "patterns": [
432
616
  {
433
- "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*\\*/)",
617
+ "match": "((?:(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*|\\d+|\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|'(?:\\\\.|[^'\\\\\\r\\n])*'))(\\s*)(:)(?=[ \\t]*/\\*[ \\t]*<extern[ \\t]+(?:(?:async[ \\t]+)?function\\*?)(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>[ \\t]*\\*/)",
434
618
  "captures": {
435
619
  "1": {
436
620
  "name": "entity.name.function.mira"
@@ -439,13 +623,9 @@
439
623
  "name": "punctuation.separator.key-value.mira"
440
624
  }
441
625
  }
442
- }
443
- ]
444
- },
445
- "extern-class-properties": {
446
- "patterns": [
626
+ },
447
627
  {
448
- "match": "((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(:)(?=\\s*/\\*\\s*<\\s*extern\\s+class(?:\\s+(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)?\\s*>\\s*\\*/)",
628
+ "match": "((?:(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*|\\d+|\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|'(?:\\\\.|[^'\\\\\\r\\n])*'))(\\s*)(:)(?=[ \\t]*/\\*[ \\t]*<extern[ \\t]+class(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>[ \\t]*\\*/)",
449
629
  "captures": {
450
630
  "1": {
451
631
  "name": "entity.name.type.mira"
@@ -457,82 +637,125 @@
457
637
  }
458
638
  ]
459
639
  },
460
- "metadata": {
640
+ "tag-comment": {
461
641
  "patterns": [
462
642
  {
463
643
  "name": "comment.block.mira",
464
- "contentName": "meta.documentation.type-hint.mira",
465
- "begin": "/\\*\\s*<",
644
+ "contentName": "meta.documentation.tag.mira",
645
+ "begin": "(/\\*)([ \\t]*)(<)(?=(?:module|function|extern)(?:[ \\t]+[^>\\r\\n]*[^>\\s])?>[ \\t]*\\*/)",
466
646
  "beginCaptures": {
467
- "0": {
647
+ "1": {
468
648
  "name": "punctuation.definition.comment.begin.mira"
649
+ },
650
+ "3": {
651
+ "name": "punctuation.definition.tag.begin.mira"
469
652
  }
470
653
  },
471
- "end": ">\\s*\\*/",
654
+ "end": "(>)([ \\t]*)(\\*/)",
472
655
  "endCaptures": {
473
- "0": {
656
+ "1": {
657
+ "name": "punctuation.definition.tag.end.mira"
658
+ },
659
+ "3": {
474
660
  "name": "punctuation.definition.comment.end.mira"
475
661
  }
476
662
  },
477
663
  "patterns": [
478
664
  {
479
- "match": "(?<!\\p{XID_Continue})(extern)(\\s+)(?:(async)(\\s+))?(function)(\\*)?(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
480
- "captures": {
481
- "1": {
482
- "name": "storage.modifier.extern.mira"
483
- },
484
- "3": {
485
- "name": "storage.modifier.async.mira"
486
- },
487
- "5": {
488
- "name": "keyword.declaration.function.mira"
489
- },
490
- "6": {
491
- "name": "keyword.operator.generator.mira"
492
- },
493
- "7": {
494
- "name": "entity.name.function.mira"
495
- }
496
- }
665
+ "include": "#tag-content"
666
+ }
667
+ ]
668
+ }
669
+ ]
670
+ },
671
+ "tag-content": {
672
+ "patterns": [
673
+ {
674
+ "match": "(extern)([ \\t]+)(?:(async)([ \\t]+))?(function)(\\*)?(?:([ \\t]+)([^>\\r\\n]*[^>\\s]))?(?=>)",
675
+ "captures": {
676
+ "1": {
677
+ "name": "keyword.declaration.extern.mira"
497
678
  },
498
- {
499
- "match": "(?<!\\p{XID_Continue})(extern)(\\s+)(class)(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
500
- "captures": {
501
- "1": {
502
- "name": "storage.modifier.extern.mira"
503
- },
504
- "3": {
505
- "name": "keyword.declaration.class.mira"
506
- },
507
- "4": {
508
- "name": "entity.name.type.mira"
509
- }
510
- }
679
+ "3": {
680
+ "name": "keyword.js"
511
681
  },
512
- {
513
- "match": "(?<!\\p{XID_Continue})(extern)(?:\\s+((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*))?",
514
- "captures": {
515
- "1": {
516
- "name": "storage.modifier.extern.mira"
517
- },
518
- "2": {
519
- "name": "entity.name.type.mira"
520
- }
521
- }
682
+ "5": {
683
+ "name": "keyword.js"
522
684
  },
523
- {
524
- "name": "entity.name.type.mira",
525
- "match": "(?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*"
685
+ "6": {
686
+ "name": "keyword.operator.generator.js"
526
687
  },
527
- {
528
- "name": "constant.numeric.mira",
529
- "match": "\\d+"
688
+ "8": {
689
+ "name": "entity.name.function.js"
690
+ }
691
+ }
692
+ },
693
+ {
694
+ "match": "(extern)([ \\t]+)(class)(?:([ \\t]+)([^>\\r\\n]*[^>\\s]))?(?=>)",
695
+ "captures": {
696
+ "1": {
697
+ "name": "keyword.declaration.extern.mira"
530
698
  },
531
- {
532
- "name": "punctuation.separator.type.mira",
533
- "match": "[().,<>]"
699
+ "3": {
700
+ "name": "keyword.js"
701
+ },
702
+ "5": {
703
+ "name": "entity.name.type.js"
534
704
  }
535
- ]
705
+ }
706
+ },
707
+ {
708
+ "match": "(extern)([ \\t]+)([^>\\r\\n]*[^>\\s])(\\()(\\d[\\d_]*(?:\\.[\\d_]+)?(?:[eE][+-]?[\\d_]*\\d)?)(\\))(?=>)",
709
+ "captures": {
710
+ "1": {
711
+ "name": "keyword.declaration.extern.mira"
712
+ },
713
+ "3": {
714
+ "name": "entity.name.type.js"
715
+ },
716
+ "4": {
717
+ "name": "punctuation.section.parens.begin.mira"
718
+ },
719
+ "5": {
720
+ "name": "constant.numeric.mira"
721
+ },
722
+ "6": {
723
+ "name": "punctuation.section.parens.end.mira"
724
+ }
725
+ }
726
+ },
727
+ {
728
+ "match": "(extern)(?:([ \\t]+)([^>\\r\\n]*[^>\\s]))?(?=>)",
729
+ "captures": {
730
+ "1": {
731
+ "name": "keyword.declaration.extern.mira"
732
+ },
733
+ "3": {
734
+ "name": "entity.name.type.js"
735
+ }
736
+ }
737
+ },
738
+ {
739
+ "match": "(module)(?:([ \\t]+)([^>\\r\\n]*[^>\\s]))?(?=>)",
740
+ "captures": {
741
+ "1": {
742
+ "name": "keyword.declaration.module.mira"
743
+ },
744
+ "3": {
745
+ "name": "entity.name.namespace.mira"
746
+ }
747
+ }
748
+ },
749
+ {
750
+ "match": "(function)(?:([ \\t]+)([^>\\r\\n]*[^>\\s]))?(?=>)",
751
+ "captures": {
752
+ "1": {
753
+ "name": "keyword.declaration.function.mira"
754
+ },
755
+ "3": {
756
+ "name": "entity.name.function.mira"
757
+ }
758
+ }
536
759
  }
537
760
  ]
538
761
  },
@@ -542,7 +765,7 @@
542
765
  "match": "(?<!\\p{XID_Continue})(type)(\\s*)(\\()(\\s*)((?:_+|@+|\\$+|\\p{XID_Start})\\p{XID_Continue}*)(\\s*)(\\))",
543
766
  "captures": {
544
767
  "1": {
545
- "name": "keyword.operator.expression.mira"
768
+ "name": "support.type.type.mira"
546
769
  },
547
770
  "3": {
548
771
  "name": "punctuation.section.parens.begin.mira"
@@ -824,11 +1047,7 @@
824
1047
  },
825
1048
  {
826
1049
  "name": "support.type.builtin.mira",
827
- "match": "(?<!\\p{XID_Continue})(?:unknown|boolean|number|string|record|extern|module|never|array|any|nil)(?!\\p{XID_Continue})"
828
- },
829
- {
830
- "name": "constant.language.boolean.mira",
831
- "match": "(?<!\\p{XID_Continue})(?:true|false)(?!\\p{XID_Continue})"
1050
+ "match": "(?<!\\p{XID_Continue})(?:unknown|boolean|number|string|record|extern|module|never|false|array|true|any|nil)(?!\\p{XID_Continue})"
832
1051
  },
833
1052
  {
834
1053
  "name": "keyword.operator.type.mira",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
2
+ "$schema": "https://www.schemastore.org/tmlanguage.json",
3
3
  "name": "mirascript-template",
4
4
  "aliases": [
5
5
  "MiraScript-Template",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
2
+ "$schema": "https://www.schemastore.org/tmlanguage.json",
3
3
  "name": "mirascript",
4
4
  "aliases": [
5
5
  "MiraScript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirascript/textmate",
3
- "version": "0.1.83",
3
+ "version": "0.1.85",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "description": "TextMate grammars for MiraScript.",
@@ -25,17 +25,17 @@
25
25
  "./*": "./dist/*.js"
26
26
  },
27
27
  "dependencies": {
28
- "@shikijs/types": "^4.4.2",
29
- "@mirascript/constants": "~0.1.83"
28
+ "@shikijs/types": "^4.4.3",
29
+ "@mirascript/constants": "~0.1.85"
30
30
  },
31
31
  "devDependencies": {
32
- "@shikijs/core": "^4.4.2",
33
- "@shikijs/engine-oniguruma": "^4.4.2",
34
- "@shikijs/vscode-textmate": "^10.0.2"
32
+ "shiki": "^4.4.3",
33
+ "ava": "^8.0.1",
34
+ "c8": "^12.0.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "pnpm clean && tsc && node ./scripts/build.ts",
38
- "test": "node --test",
38
+ "test": "c8 ava",
39
39
  "clean": "rimraf dist"
40
40
  }
41
41
  }