@algosail/tree-sitter 0.1.4 → 0.1.6
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/grammar.js +8 -5
- package/package.json +1 -1
- package/src/grammar.json +19 -7
- package/src/node-types.json +82 -70
- package/src/parser.c +1354 -1322
- package/tree-sitter-sail.wasm +0 -0
package/grammar.js
CHANGED
|
@@ -57,6 +57,8 @@ module.exports = grammar({
|
|
|
57
57
|
module_group_ref: ($) => /~[A-Z][a-zA-Z0-9_]*&[A-Z][a-zA-Z0-9_]*/,
|
|
58
58
|
// ~Module#Tag
|
|
59
59
|
module_tag_ref: ($) => /~[A-Z][a-zA-Z0-9_]*#[A-Z][a-zA-Z0-9_]*/,
|
|
60
|
+
// ~Module#Tag
|
|
61
|
+
module_tag_pattern: ($) => /~[A-Z][a-zA-Z0-9_]*\_[A-Z][a-zA-Z0-9_]*/,
|
|
60
62
|
// ~Module$Map
|
|
61
63
|
module_map_ref: ($) => /~[A-Z][a-zA-Z0-9_]*\$[A-Z][a-zA-Z0-9_]*/,
|
|
62
64
|
// ~Module$Map.field
|
|
@@ -77,10 +79,10 @@ module.exports = grammar({
|
|
|
77
79
|
effect_remove: ($) => /\-[A-Z][a-zA-Z0-9_]*/,
|
|
78
80
|
|
|
79
81
|
// :name
|
|
80
|
-
|
|
82
|
+
slot_write: ($) => /:[a-z][a-zA-Z0-9_]*/,
|
|
81
83
|
|
|
82
84
|
// ;name
|
|
83
|
-
|
|
85
|
+
slot_read: ($) => /;[a-z][a-zA-Z0-9_]*/,
|
|
84
86
|
|
|
85
87
|
// 'raw string literal'
|
|
86
88
|
raw_string: ($) => /\'[^\']*\'/,
|
|
@@ -141,7 +143,7 @@ module.exports = grammar({
|
|
|
141
143
|
field('name_def', $.word_def),
|
|
142
144
|
field('sig', $.signature),
|
|
143
145
|
optional(field('doc', $.comment)),
|
|
144
|
-
repeat($._expr),
|
|
146
|
+
field('body', repeat($._expr)),
|
|
145
147
|
),
|
|
146
148
|
),
|
|
147
149
|
|
|
@@ -180,11 +182,12 @@ module.exports = grammar({
|
|
|
180
182
|
$.tag_ref,
|
|
181
183
|
$.module_tag_ref,
|
|
182
184
|
$.tag_pattern,
|
|
185
|
+
$.module_tag_pattern,
|
|
183
186
|
$.default_pattern,
|
|
184
187
|
$.field_ref,
|
|
185
188
|
$.module_field_ref,
|
|
186
|
-
$.
|
|
187
|
-
$.
|
|
189
|
+
$.slot_write,
|
|
190
|
+
$.slot_read,
|
|
188
191
|
$.raw_string,
|
|
189
192
|
$.raw_value,
|
|
190
193
|
),
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -101,6 +101,10 @@
|
|
|
101
101
|
"type": "PATTERN",
|
|
102
102
|
"value": "~[A-Z][a-zA-Z0-9_]*#[A-Z][a-zA-Z0-9_]*"
|
|
103
103
|
},
|
|
104
|
+
"module_tag_pattern": {
|
|
105
|
+
"type": "PATTERN",
|
|
106
|
+
"value": "~[A-Z][a-zA-Z0-9_]*\\_[A-Z][a-zA-Z0-9_]*"
|
|
107
|
+
},
|
|
104
108
|
"module_map_ref": {
|
|
105
109
|
"type": "PATTERN",
|
|
106
110
|
"value": "~[A-Z][a-zA-Z0-9_]*\\$[A-Z][a-zA-Z0-9_]*"
|
|
@@ -133,11 +137,11 @@
|
|
|
133
137
|
"type": "PATTERN",
|
|
134
138
|
"value": "\\-[A-Z][a-zA-Z0-9_]*"
|
|
135
139
|
},
|
|
136
|
-
"
|
|
140
|
+
"slot_write": {
|
|
137
141
|
"type": "PATTERN",
|
|
138
142
|
"value": ":[a-z][a-zA-Z0-9_]*"
|
|
139
143
|
},
|
|
140
|
-
"
|
|
144
|
+
"slot_read": {
|
|
141
145
|
"type": "PATTERN",
|
|
142
146
|
"value": ";[a-z][a-zA-Z0-9_]*"
|
|
143
147
|
},
|
|
@@ -522,10 +526,14 @@
|
|
|
522
526
|
]
|
|
523
527
|
},
|
|
524
528
|
{
|
|
525
|
-
"type": "
|
|
529
|
+
"type": "FIELD",
|
|
530
|
+
"name": "body",
|
|
526
531
|
"content": {
|
|
527
|
-
"type": "
|
|
528
|
-
"
|
|
532
|
+
"type": "REPEAT",
|
|
533
|
+
"content": {
|
|
534
|
+
"type": "SYMBOL",
|
|
535
|
+
"name": "_expr"
|
|
536
|
+
}
|
|
529
537
|
}
|
|
530
538
|
}
|
|
531
539
|
]
|
|
@@ -700,6 +708,10 @@
|
|
|
700
708
|
"type": "SYMBOL",
|
|
701
709
|
"name": "tag_pattern"
|
|
702
710
|
},
|
|
711
|
+
{
|
|
712
|
+
"type": "SYMBOL",
|
|
713
|
+
"name": "module_tag_pattern"
|
|
714
|
+
},
|
|
703
715
|
{
|
|
704
716
|
"type": "SYMBOL",
|
|
705
717
|
"name": "default_pattern"
|
|
@@ -714,11 +726,11 @@
|
|
|
714
726
|
},
|
|
715
727
|
{
|
|
716
728
|
"type": "SYMBOL",
|
|
717
|
-
"name": "
|
|
729
|
+
"name": "slot_write"
|
|
718
730
|
},
|
|
719
731
|
{
|
|
720
732
|
"type": "SYMBOL",
|
|
721
|
-
"name": "
|
|
733
|
+
"name": "slot_read"
|
|
722
734
|
},
|
|
723
735
|
{
|
|
724
736
|
"type": "SYMBOL",
|
package/src/node-types.json
CHANGED
|
@@ -279,6 +279,10 @@
|
|
|
279
279
|
"type": "module_field_ref",
|
|
280
280
|
"named": true
|
|
281
281
|
},
|
|
282
|
+
{
|
|
283
|
+
"type": "module_tag_pattern",
|
|
284
|
+
"named": true
|
|
285
|
+
},
|
|
282
286
|
{
|
|
283
287
|
"type": "module_tag_ref",
|
|
284
288
|
"named": true
|
|
@@ -300,11 +304,11 @@
|
|
|
300
304
|
"named": true
|
|
301
305
|
},
|
|
302
306
|
{
|
|
303
|
-
"type": "
|
|
307
|
+
"type": "slot_read",
|
|
304
308
|
"named": true
|
|
305
309
|
},
|
|
306
310
|
{
|
|
307
|
-
"type": "
|
|
311
|
+
"type": "slot_write",
|
|
308
312
|
"named": true
|
|
309
313
|
},
|
|
310
314
|
{
|
|
@@ -565,6 +569,76 @@
|
|
|
565
569
|
"type": "word",
|
|
566
570
|
"named": true,
|
|
567
571
|
"fields": {
|
|
572
|
+
"body": {
|
|
573
|
+
"multiple": true,
|
|
574
|
+
"required": false,
|
|
575
|
+
"types": [
|
|
576
|
+
{
|
|
577
|
+
"type": "builtin_word",
|
|
578
|
+
"named": true
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"type": "comment",
|
|
582
|
+
"named": true
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"type": "default_pattern",
|
|
586
|
+
"named": true
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"type": "field_ref",
|
|
590
|
+
"named": true
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"type": "module_field_ref",
|
|
594
|
+
"named": true
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"type": "module_tag_pattern",
|
|
598
|
+
"named": true
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"type": "module_tag_ref",
|
|
602
|
+
"named": true
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"type": "module_word_ref",
|
|
606
|
+
"named": true
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"type": "quotation",
|
|
610
|
+
"named": true
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"type": "raw_string",
|
|
614
|
+
"named": true
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"type": "raw_value",
|
|
618
|
+
"named": true
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"type": "slot_read",
|
|
622
|
+
"named": true
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"type": "slot_write",
|
|
626
|
+
"named": true
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"type": "tag_pattern",
|
|
630
|
+
"named": true
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"type": "tag_ref",
|
|
634
|
+
"named": true
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"type": "word_ref",
|
|
638
|
+
"named": true
|
|
639
|
+
}
|
|
640
|
+
]
|
|
641
|
+
},
|
|
568
642
|
"doc": {
|
|
569
643
|
"multiple": false,
|
|
570
644
|
"required": false,
|
|
@@ -595,72 +669,6 @@
|
|
|
595
669
|
}
|
|
596
670
|
]
|
|
597
671
|
}
|
|
598
|
-
},
|
|
599
|
-
"children": {
|
|
600
|
-
"multiple": true,
|
|
601
|
-
"required": false,
|
|
602
|
-
"types": [
|
|
603
|
-
{
|
|
604
|
-
"type": "builtin_word",
|
|
605
|
-
"named": true
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
"type": "comment",
|
|
609
|
-
"named": true
|
|
610
|
-
},
|
|
611
|
-
{
|
|
612
|
-
"type": "default_pattern",
|
|
613
|
-
"named": true
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"type": "field_ref",
|
|
617
|
-
"named": true
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
"type": "module_field_ref",
|
|
621
|
-
"named": true
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
"type": "module_tag_ref",
|
|
625
|
-
"named": true
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
"type": "module_word_ref",
|
|
629
|
-
"named": true
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
"type": "quotation",
|
|
633
|
-
"named": true
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
"type": "raw_string",
|
|
637
|
-
"named": true
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
"type": "raw_value",
|
|
641
|
-
"named": true
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
"type": "slot_pop",
|
|
645
|
-
"named": true
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
"type": "slot_push",
|
|
649
|
-
"named": true
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
"type": "tag_pattern",
|
|
653
|
-
"named": true
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
"type": "tag_ref",
|
|
657
|
-
"named": true
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
"type": "word_ref",
|
|
661
|
-
"named": true
|
|
662
|
-
}
|
|
663
|
-
]
|
|
664
672
|
}
|
|
665
673
|
},
|
|
666
674
|
{
|
|
@@ -711,6 +719,10 @@
|
|
|
711
719
|
"type": "module_map_ref",
|
|
712
720
|
"named": true
|
|
713
721
|
},
|
|
722
|
+
{
|
|
723
|
+
"type": "module_tag_pattern",
|
|
724
|
+
"named": true
|
|
725
|
+
},
|
|
714
726
|
{
|
|
715
727
|
"type": "module_tag_ref",
|
|
716
728
|
"named": true
|
|
@@ -736,11 +748,11 @@
|
|
|
736
748
|
"named": true
|
|
737
749
|
},
|
|
738
750
|
{
|
|
739
|
-
"type": "
|
|
751
|
+
"type": "slot_read",
|
|
740
752
|
"named": true
|
|
741
753
|
},
|
|
742
754
|
{
|
|
743
|
-
"type": "
|
|
755
|
+
"type": "slot_write",
|
|
744
756
|
"named": true
|
|
745
757
|
},
|
|
746
758
|
{
|