@algosail/tree-sitter 0.1.0

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,633 @@
1
+ {
2
+ "name": "sail",
3
+ "rules": {
4
+ "source_file": {
5
+ "type": "REPEAT",
6
+ "content": {
7
+ "type": "SYMBOL",
8
+ "name": "_top_level"
9
+ }
10
+ },
11
+ "_top_level": {
12
+ "type": "CHOICE",
13
+ "members": [
14
+ {
15
+ "type": "SYMBOL",
16
+ "name": "comment"
17
+ },
18
+ {
19
+ "type": "SYMBOL",
20
+ "name": "module_def"
21
+ },
22
+ {
23
+ "type": "SYMBOL",
24
+ "name": "import_decl"
25
+ },
26
+ {
27
+ "type": "SYMBOL",
28
+ "name": "tag_group"
29
+ },
30
+ {
31
+ "type": "SYMBOL",
32
+ "name": "map_def"
33
+ },
34
+ {
35
+ "type": "SYMBOL",
36
+ "name": "word_def"
37
+ }
38
+ ]
39
+ },
40
+ "comment": {
41
+ "type": "SEQ",
42
+ "members": [
43
+ {
44
+ "type": "STRING",
45
+ "value": "("
46
+ },
47
+ {
48
+ "type": "CHOICE",
49
+ "members": [
50
+ {
51
+ "type": "SYMBOL",
52
+ "name": "comment_content"
53
+ },
54
+ {
55
+ "type": "BLANK"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "type": "STRING",
61
+ "value": ")"
62
+ }
63
+ ]
64
+ },
65
+ "comment_content": {
66
+ "type": "PATTERN",
67
+ "value": "[^()]+"
68
+ },
69
+ "module_def": {
70
+ "type": "FIELD",
71
+ "name": "name",
72
+ "content": {
73
+ "type": "SYMBOL",
74
+ "name": "module_name"
75
+ }
76
+ },
77
+ "module_name": {
78
+ "type": "PATTERN",
79
+ "value": "![A-Z][a-zA-Z0-9_]*"
80
+ },
81
+ "import_decl": {
82
+ "type": "SEQ",
83
+ "members": [
84
+ {
85
+ "type": "FIELD",
86
+ "name": "path",
87
+ "content": {
88
+ "type": "SYMBOL",
89
+ "name": "import_path"
90
+ }
91
+ },
92
+ {
93
+ "type": "FIELD",
94
+ "name": "alias",
95
+ "content": {
96
+ "type": "SYMBOL",
97
+ "name": "module_alias"
98
+ }
99
+ }
100
+ ]
101
+ },
102
+ "import_path": {
103
+ "type": "PATTERN",
104
+ "value": "\\|[^\\s]+"
105
+ },
106
+ "module_alias": {
107
+ "type": "PATTERN",
108
+ "value": "~[A-Z][a-zA-Z0-9_]*"
109
+ },
110
+ "tag_group": {
111
+ "type": "SEQ",
112
+ "members": [
113
+ {
114
+ "type": "FIELD",
115
+ "name": "name",
116
+ "content": {
117
+ "type": "SYMBOL",
118
+ "name": "tag_group_name"
119
+ }
120
+ },
121
+ {
122
+ "type": "REPEAT",
123
+ "content": {
124
+ "type": "SYMBOL",
125
+ "name": "type_variable"
126
+ }
127
+ },
128
+ {
129
+ "type": "REPEAT",
130
+ "content": {
131
+ "type": "SYMBOL",
132
+ "name": "tag_def"
133
+ }
134
+ }
135
+ ]
136
+ },
137
+ "tag_group_name": {
138
+ "type": "PATTERN",
139
+ "value": "&[A-Z][a-zA-Z0-9_]*"
140
+ },
141
+ "tag_def": {
142
+ "type": "SEQ",
143
+ "members": [
144
+ {
145
+ "type": "FIELD",
146
+ "name": "name",
147
+ "content": {
148
+ "type": "SYMBOL",
149
+ "name": "tag_name"
150
+ }
151
+ },
152
+ {
153
+ "type": "REPEAT",
154
+ "content": {
155
+ "type": "SYMBOL",
156
+ "name": "type_variable"
157
+ }
158
+ }
159
+ ]
160
+ },
161
+ "tag_name": {
162
+ "type": "PATTERN",
163
+ "value": ">[A-Z][a-zA-Z0-9_]*"
164
+ },
165
+ "map_def": {
166
+ "type": "SEQ",
167
+ "members": [
168
+ {
169
+ "type": "FIELD",
170
+ "name": "name",
171
+ "content": {
172
+ "type": "SYMBOL",
173
+ "name": "map_name"
174
+ }
175
+ },
176
+ {
177
+ "type": "REPEAT",
178
+ "content": {
179
+ "type": "SYMBOL",
180
+ "name": "map_field"
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ "map_name": {
186
+ "type": "PATTERN",
187
+ "value": "%[A-Z][a-zA-Z0-9_]*"
188
+ },
189
+ "map_field": {
190
+ "type": "SEQ",
191
+ "members": [
192
+ {
193
+ "type": "FIELD",
194
+ "name": "key",
195
+ "content": {
196
+ "type": "SYMBOL",
197
+ "name": "map_field_name"
198
+ }
199
+ },
200
+ {
201
+ "type": "FIELD",
202
+ "name": "type",
203
+ "content": {
204
+ "type": "SYMBOL",
205
+ "name": "type_name"
206
+ }
207
+ }
208
+ ]
209
+ },
210
+ "map_field_name": {
211
+ "type": "PATTERN",
212
+ "value": ":[a-z][a-zA-Z0-9_]*"
213
+ },
214
+ "word_def": {
215
+ "type": "PREC_RIGHT",
216
+ "value": 0,
217
+ "content": {
218
+ "type": "SEQ",
219
+ "members": [
220
+ {
221
+ "type": "FIELD",
222
+ "name": "name",
223
+ "content": {
224
+ "type": "SYMBOL",
225
+ "name": "word_name"
226
+ }
227
+ },
228
+ {
229
+ "type": "FIELD",
230
+ "name": "sig",
231
+ "content": {
232
+ "type": "SYMBOL",
233
+ "name": "signature"
234
+ }
235
+ },
236
+ {
237
+ "type": "REPEAT",
238
+ "content": {
239
+ "type": "SYMBOL",
240
+ "name": "_expr"
241
+ }
242
+ }
243
+ ]
244
+ }
245
+ },
246
+ "word_name": {
247
+ "type": "PATTERN",
248
+ "value": "@[a-z][a-zA-Z0-9_]*"
249
+ },
250
+ "signature": {
251
+ "type": "SEQ",
252
+ "members": [
253
+ {
254
+ "type": "STRING",
255
+ "value": "("
256
+ },
257
+ {
258
+ "type": "REPEAT",
259
+ "content": {
260
+ "type": "SYMBOL",
261
+ "name": "_sig_item"
262
+ }
263
+ },
264
+ {
265
+ "type": "SYMBOL",
266
+ "name": "sig_arrow"
267
+ },
268
+ {
269
+ "type": "REPEAT",
270
+ "content": {
271
+ "type": "SYMBOL",
272
+ "name": "_sig_item"
273
+ }
274
+ },
275
+ {
276
+ "type": "STRING",
277
+ "value": ")"
278
+ }
279
+ ]
280
+ },
281
+ "sig_arrow": {
282
+ "type": "TOKEN",
283
+ "content": {
284
+ "type": "STRING",
285
+ "value": "--"
286
+ }
287
+ },
288
+ "_sig_item": {
289
+ "type": "CHOICE",
290
+ "members": [
291
+ {
292
+ "type": "SYMBOL",
293
+ "name": "effect_add"
294
+ },
295
+ {
296
+ "type": "SYMBOL",
297
+ "name": "effect_remove"
298
+ },
299
+ {
300
+ "type": "SYMBOL",
301
+ "name": "spread"
302
+ },
303
+ {
304
+ "type": "SYMBOL",
305
+ "name": "type_name"
306
+ },
307
+ {
308
+ "type": "SYMBOL",
309
+ "name": "type_variable"
310
+ },
311
+ {
312
+ "type": "SYMBOL",
313
+ "name": "sig_list"
314
+ },
315
+ {
316
+ "type": "SYMBOL",
317
+ "name": "sig_quotation"
318
+ }
319
+ ]
320
+ },
321
+ "sig_list": {
322
+ "type": "SEQ",
323
+ "members": [
324
+ {
325
+ "type": "STRING",
326
+ "value": "["
327
+ },
328
+ {
329
+ "type": "REPEAT",
330
+ "content": {
331
+ "type": "SYMBOL",
332
+ "name": "_sig_item"
333
+ }
334
+ },
335
+ {
336
+ "type": "STRING",
337
+ "value": "]"
338
+ }
339
+ ]
340
+ },
341
+ "sig_quotation": {
342
+ "type": "SEQ",
343
+ "members": [
344
+ {
345
+ "type": "STRING",
346
+ "value": "("
347
+ },
348
+ {
349
+ "type": "REPEAT",
350
+ "content": {
351
+ "type": "SYMBOL",
352
+ "name": "_sig_item"
353
+ }
354
+ },
355
+ {
356
+ "type": "SYMBOL",
357
+ "name": "sig_arrow"
358
+ },
359
+ {
360
+ "type": "REPEAT",
361
+ "content": {
362
+ "type": "SYMBOL",
363
+ "name": "_sig_item"
364
+ }
365
+ },
366
+ {
367
+ "type": "STRING",
368
+ "value": ")"
369
+ }
370
+ ]
371
+ },
372
+ "effect_add": {
373
+ "type": "PATTERN",
374
+ "value": "\\+[A-Z][a-zA-Z0-9_]*"
375
+ },
376
+ "effect_remove": {
377
+ "type": "PATTERN",
378
+ "value": "-[A-Z][a-zA-Z0-9_]*"
379
+ },
380
+ "spread": {
381
+ "type": "PATTERN",
382
+ "value": "\\.\\.[a-zA-Z][a-zA-Z0-9_]*"
383
+ },
384
+ "type_name": {
385
+ "type": "PATTERN",
386
+ "value": "[A-Z][a-zA-Z0-9_]*"
387
+ },
388
+ "type_variable": {
389
+ "type": "PATTERN",
390
+ "value": "[a-z][a-zA-Z0-9_]*"
391
+ },
392
+ "_expr": {
393
+ "type": "CHOICE",
394
+ "members": [
395
+ {
396
+ "type": "SYMBOL",
397
+ "name": "comment"
398
+ },
399
+ {
400
+ "type": "SYMBOL",
401
+ "name": "quotation"
402
+ },
403
+ {
404
+ "type": "SYMBOL",
405
+ "name": "builtin_word"
406
+ },
407
+ {
408
+ "type": "SYMBOL",
409
+ "name": "word_call"
410
+ },
411
+ {
412
+ "type": "SYMBOL",
413
+ "name": "module_call"
414
+ },
415
+ {
416
+ "type": "SYMBOL",
417
+ "name": "map_access"
418
+ },
419
+ {
420
+ "type": "SYMBOL",
421
+ "name": "tag_constructor"
422
+ },
423
+ {
424
+ "type": "SYMBOL",
425
+ "name": "tag_pattern"
426
+ },
427
+ {
428
+ "type": "SYMBOL",
429
+ "name": "slot_push"
430
+ },
431
+ {
432
+ "type": "SYMBOL",
433
+ "name": "slot_pop"
434
+ },
435
+ {
436
+ "type": "SYMBOL",
437
+ "name": "raw_string"
438
+ },
439
+ {
440
+ "type": "SYMBOL",
441
+ "name": "number"
442
+ },
443
+ {
444
+ "type": "SYMBOL",
445
+ "name": "identifier"
446
+ }
447
+ ]
448
+ },
449
+ "quotation": {
450
+ "type": "SEQ",
451
+ "members": [
452
+ {
453
+ "type": "STRING",
454
+ "value": "["
455
+ },
456
+ {
457
+ "type": "REPEAT",
458
+ "content": {
459
+ "type": "SYMBOL",
460
+ "name": "_expr"
461
+ }
462
+ },
463
+ {
464
+ "type": "STRING",
465
+ "value": "]"
466
+ }
467
+ ]
468
+ },
469
+ "builtin_word": {
470
+ "type": "TOKEN",
471
+ "content": {
472
+ "type": "CHOICE",
473
+ "members": [
474
+ {
475
+ "type": "STRING",
476
+ "value": "DUP"
477
+ },
478
+ {
479
+ "type": "STRING",
480
+ "value": "SWAP"
481
+ },
482
+ {
483
+ "type": "STRING",
484
+ "value": "DROP"
485
+ },
486
+ {
487
+ "type": "STRING",
488
+ "value": "OVER"
489
+ },
490
+ {
491
+ "type": "STRING",
492
+ "value": "ROT"
493
+ },
494
+ {
495
+ "type": "STRING",
496
+ "value": "ROTR"
497
+ },
498
+ {
499
+ "type": "STRING",
500
+ "value": "NIP"
501
+ },
502
+ {
503
+ "type": "STRING",
504
+ "value": "TUCK"
505
+ },
506
+ {
507
+ "type": "STRING",
508
+ "value": "DUP2"
509
+ },
510
+ {
511
+ "type": "STRING",
512
+ "value": "DROP2"
513
+ },
514
+ {
515
+ "type": "STRING",
516
+ "value": "SWAP2"
517
+ },
518
+ {
519
+ "type": "STRING",
520
+ "value": "CALL"
521
+ },
522
+ {
523
+ "type": "STRING",
524
+ "value": "MATCH"
525
+ },
526
+ {
527
+ "type": "STRING",
528
+ "value": "COMPOSE"
529
+ },
530
+ {
531
+ "type": "STRING",
532
+ "value": "IF"
533
+ },
534
+ {
535
+ "type": "STRING",
536
+ "value": "MAP"
537
+ },
538
+ {
539
+ "type": "STRING",
540
+ "value": "GETL"
541
+ },
542
+ {
543
+ "type": "STRING",
544
+ "value": "SETL"
545
+ },
546
+ {
547
+ "type": "STRING",
548
+ "value": "UPDL"
549
+ },
550
+ {
551
+ "type": "STRING",
552
+ "value": "APP"
553
+ },
554
+ {
555
+ "type": "STRING",
556
+ "value": "ERROR"
557
+ }
558
+ ]
559
+ }
560
+ },
561
+ "word_call": {
562
+ "type": "PATTERN",
563
+ "value": "\\/[a-z][a-zA-Z0-9_]*"
564
+ },
565
+ "module_call": {
566
+ "type": "PATTERN",
567
+ "value": "~[A-Z][a-zA-Z0-9_]*(\\/[a-zA-Z][a-zA-Z0-9_]*)?"
568
+ },
569
+ "map_access": {
570
+ "type": "PATTERN",
571
+ "value": "\\*[A-Z][a-zA-Z0-9_]*\\/[a-z][a-zA-Z0-9_]*"
572
+ },
573
+ "tag_constructor": {
574
+ "type": "PATTERN",
575
+ "value": "#[A-Z][a-zA-Z0-9_]*"
576
+ },
577
+ "tag_pattern": {
578
+ "type": "PATTERN",
579
+ "value": "_[A-Z][a-zA-Z0-9_]*"
580
+ },
581
+ "slot_push": {
582
+ "type": "PATTERN",
583
+ "value": "\\.[a-z][a-zA-Z0-9_]*"
584
+ },
585
+ "slot_pop": {
586
+ "type": "PATTERN",
587
+ "value": ",[a-z][a-zA-Z0-9_]*"
588
+ },
589
+ "raw_string": {
590
+ "type": "PATTERN",
591
+ "value": "\\'[^\\']*\\'"
592
+ },
593
+ "number": {
594
+ "type": "PATTERN",
595
+ "value": "[0-9]+(\\.[0-9]+)?"
596
+ },
597
+ "identifier": {
598
+ "type": "PATTERN",
599
+ "value": "[a-zA-Z_][a-zA-Z0-9_]*"
600
+ }
601
+ },
602
+ "extras": [
603
+ {
604
+ "type": "PATTERN",
605
+ "value": "\\s+"
606
+ }
607
+ ],
608
+ "conflicts": [
609
+ [
610
+ "comment",
611
+ "signature"
612
+ ],
613
+ [
614
+ "comment",
615
+ "sig_quotation"
616
+ ],
617
+ [
618
+ "word_def"
619
+ ],
620
+ [
621
+ "tag_def",
622
+ "tag_group"
623
+ ],
624
+ [
625
+ "type_variable",
626
+ "identifier"
627
+ ]
628
+ ],
629
+ "precedences": [],
630
+ "externals": [],
631
+ "inline": [],
632
+ "supertypes": []
633
+ }