tree-sitter-familymarkup 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,760 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
3
+ "name": "familymarkup",
4
+ "rules": {
5
+ "root": {
6
+ "type": "SEQ",
7
+ "members": [
8
+ {
9
+ "type": "CHOICE",
10
+ "members": [
11
+ {
12
+ "type": "CHOICE",
13
+ "members": [
14
+ {
15
+ "type": "SYMBOL",
16
+ "name": "_nl"
17
+ },
18
+ {
19
+ "type": "SYMBOL",
20
+ "name": "_multi_newline"
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "type": "BLANK"
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "type": "SEQ",
31
+ "members": [
32
+ {
33
+ "type": "SYMBOL",
34
+ "name": "family"
35
+ },
36
+ {
37
+ "type": "CHOICE",
38
+ "members": [
39
+ {
40
+ "type": "REPEAT",
41
+ "content": {
42
+ "type": "SEQ",
43
+ "members": [
44
+ {
45
+ "type": "SYMBOL",
46
+ "name": "_multi_newline"
47
+ },
48
+ {
49
+ "type": "SYMBOL",
50
+ "name": "family"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "type": "BLANK"
57
+ }
58
+ ]
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "type": "CHOICE",
64
+ "members": [
65
+ {
66
+ "type": "CHOICE",
67
+ "members": [
68
+ {
69
+ "type": "SYMBOL",
70
+ "name": "_nl"
71
+ },
72
+ {
73
+ "type": "SYMBOL",
74
+ "name": "_multi_newline"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "type": "BLANK"
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ "_multi_newline": {
86
+ "type": "PATTERN",
87
+ "value": "\\r?\\n[\\r\\n\\s]*\\r?\\n"
88
+ },
89
+ "_nl": {
90
+ "type": "PATTERN",
91
+ "value": "\\r?\\n"
92
+ },
93
+ "family": {
94
+ "type": "SEQ",
95
+ "members": [
96
+ {
97
+ "type": "FIELD",
98
+ "name": "name",
99
+ "content": {
100
+ "type": "SYMBOL",
101
+ "name": "family_name"
102
+ }
103
+ },
104
+ {
105
+ "type": "CHOICE",
106
+ "members": [
107
+ {
108
+ "type": "SEQ",
109
+ "members": [
110
+ {
111
+ "type": "SYMBOL",
112
+ "name": "_nl"
113
+ },
114
+ {
115
+ "type": "SEQ",
116
+ "members": [
117
+ {
118
+ "type": "SYMBOL",
119
+ "name": "comment"
120
+ },
121
+ {
122
+ "type": "CHOICE",
123
+ "members": [
124
+ {
125
+ "type": "REPEAT",
126
+ "content": {
127
+ "type": "SEQ",
128
+ "members": [
129
+ {
130
+ "type": "SYMBOL",
131
+ "name": "_nl"
132
+ },
133
+ {
134
+ "type": "SYMBOL",
135
+ "name": "comment"
136
+ }
137
+ ]
138
+ }
139
+ },
140
+ {
141
+ "type": "BLANK"
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "type": "BLANK"
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "type": "CHOICE",
156
+ "members": [
157
+ {
158
+ "type": "SEQ",
159
+ "members": [
160
+ {
161
+ "type": "SYMBOL",
162
+ "name": "_multi_newline"
163
+ },
164
+ {
165
+ "type": "SYMBOL",
166
+ "name": "relations"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "type": "BLANK"
172
+ }
173
+ ]
174
+ }
175
+ ]
176
+ },
177
+ "relations": {
178
+ "type": "SEQ",
179
+ "members": [
180
+ {
181
+ "type": "SYMBOL",
182
+ "name": "relation"
183
+ },
184
+ {
185
+ "type": "CHOICE",
186
+ "members": [
187
+ {
188
+ "type": "REPEAT",
189
+ "content": {
190
+ "type": "SEQ",
191
+ "members": [
192
+ {
193
+ "type": "SYMBOL",
194
+ "name": "_multi_newline"
195
+ },
196
+ {
197
+ "type": "SYMBOL",
198
+ "name": "relation"
199
+ }
200
+ ]
201
+ }
202
+ },
203
+ {
204
+ "type": "BLANK"
205
+ }
206
+ ]
207
+ }
208
+ ]
209
+ },
210
+ "relation": {
211
+ "type": "SEQ",
212
+ "members": [
213
+ {
214
+ "type": "FIELD",
215
+ "name": "sources",
216
+ "content": {
217
+ "type": "SYMBOL",
218
+ "name": "sources"
219
+ }
220
+ },
221
+ {
222
+ "type": "FIELD",
223
+ "name": "arrow",
224
+ "content": {
225
+ "type": "SYMBOL",
226
+ "name": "_arrows"
227
+ }
228
+ },
229
+ {
230
+ "type": "FIELD",
231
+ "name": "label",
232
+ "content": {
233
+ "type": "CHOICE",
234
+ "members": [
235
+ {
236
+ "type": "SYMBOL",
237
+ "name": "words"
238
+ },
239
+ {
240
+ "type": "BLANK"
241
+ }
242
+ ]
243
+ }
244
+ },
245
+ {
246
+ "type": "CHOICE",
247
+ "members": [
248
+ {
249
+ "type": "SYMBOL",
250
+ "name": "_nl"
251
+ },
252
+ {
253
+ "type": "BLANK"
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "type": "FIELD",
259
+ "name": "targets",
260
+ "content": {
261
+ "type": "CHOICE",
262
+ "members": [
263
+ {
264
+ "type": "SYMBOL",
265
+ "name": "targets"
266
+ },
267
+ {
268
+ "type": "BLANK"
269
+ }
270
+ ]
271
+ }
272
+ }
273
+ ]
274
+ },
275
+ "sources": {
276
+ "type": "SEQ",
277
+ "members": [
278
+ {
279
+ "type": "CHOICE",
280
+ "members": [
281
+ {
282
+ "type": "SYMBOL",
283
+ "name": "name_ref"
284
+ },
285
+ {
286
+ "type": "SYMBOL",
287
+ "name": "name"
288
+ },
289
+ {
290
+ "type": "SYMBOL",
291
+ "name": "unknown"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "type": "CHOICE",
297
+ "members": [
298
+ {
299
+ "type": "REPEAT",
300
+ "content": {
301
+ "type": "SEQ",
302
+ "members": [
303
+ {
304
+ "type": "FIELD",
305
+ "name": "delimiter",
306
+ "content": {
307
+ "type": "CHOICE",
308
+ "members": [
309
+ {
310
+ "type": "STRING",
311
+ "value": "+"
312
+ },
313
+ {
314
+ "type": "STRING",
315
+ "value": ","
316
+ },
317
+ {
318
+ "type": "SYMBOL",
319
+ "name": "_words"
320
+ }
321
+ ]
322
+ }
323
+ },
324
+ {
325
+ "type": "CHOICE",
326
+ "members": [
327
+ {
328
+ "type": "SYMBOL",
329
+ "name": "name_ref"
330
+ },
331
+ {
332
+ "type": "SYMBOL",
333
+ "name": "name"
334
+ },
335
+ {
336
+ "type": "SYMBOL",
337
+ "name": "unknown"
338
+ }
339
+ ]
340
+ }
341
+ ]
342
+ }
343
+ },
344
+ {
345
+ "type": "BLANK"
346
+ }
347
+ ]
348
+ }
349
+ ]
350
+ },
351
+ "targets": {
352
+ "type": "SEQ",
353
+ "members": [
354
+ {
355
+ "type": "CHOICE",
356
+ "members": [
357
+ {
358
+ "type": "SYMBOL",
359
+ "name": "name_ref"
360
+ },
361
+ {
362
+ "type": "SYMBOL",
363
+ "name": "name_def"
364
+ },
365
+ {
366
+ "type": "SYMBOL",
367
+ "name": "num_unknown"
368
+ },
369
+ {
370
+ "type": "SYMBOL",
371
+ "name": "unknown"
372
+ },
373
+ {
374
+ "type": "SYMBOL",
375
+ "name": "comment"
376
+ }
377
+ ]
378
+ },
379
+ {
380
+ "type": "CHOICE",
381
+ "members": [
382
+ {
383
+ "type": "REPEAT",
384
+ "content": {
385
+ "type": "SEQ",
386
+ "members": [
387
+ {
388
+ "type": "FIELD",
389
+ "name": "delimiter",
390
+ "content": {
391
+ "type": "CHOICE",
392
+ "members": [
393
+ {
394
+ "type": "STRING",
395
+ "value": ","
396
+ },
397
+ {
398
+ "type": "SYMBOL",
399
+ "name": "_nl"
400
+ },
401
+ {
402
+ "type": "SYMBOL",
403
+ "name": "_words"
404
+ }
405
+ ]
406
+ }
407
+ },
408
+ {
409
+ "type": "CHOICE",
410
+ "members": [
411
+ {
412
+ "type": "SYMBOL",
413
+ "name": "name_ref"
414
+ },
415
+ {
416
+ "type": "SYMBOL",
417
+ "name": "name_def"
418
+ },
419
+ {
420
+ "type": "SYMBOL",
421
+ "name": "num_unknown"
422
+ },
423
+ {
424
+ "type": "SYMBOL",
425
+ "name": "unknown"
426
+ },
427
+ {
428
+ "type": "SYMBOL",
429
+ "name": "comment"
430
+ }
431
+ ]
432
+ }
433
+ ]
434
+ }
435
+ },
436
+ {
437
+ "type": "BLANK"
438
+ }
439
+ ]
440
+ }
441
+ ]
442
+ },
443
+ "name_ref": {
444
+ "type": "SEQ",
445
+ "members": [
446
+ {
447
+ "type": "ALIAS",
448
+ "content": {
449
+ "type": "SYMBOL",
450
+ "name": "name"
451
+ },
452
+ "named": true,
453
+ "value": "surname"
454
+ },
455
+ {
456
+ "type": "SYMBOL",
457
+ "name": "name"
458
+ }
459
+ ]
460
+ },
461
+ "family_name": {
462
+ "type": "SEQ",
463
+ "members": [
464
+ {
465
+ "type": "FIELD",
466
+ "name": "name",
467
+ "content": {
468
+ "type": "SYMBOL",
469
+ "name": "name"
470
+ }
471
+ },
472
+ {
473
+ "type": "FIELD",
474
+ "name": "aliases",
475
+ "content": {
476
+ "type": "CHOICE",
477
+ "members": [
478
+ {
479
+ "type": "SYMBOL",
480
+ "name": "name_aliases"
481
+ },
482
+ {
483
+ "type": "BLANK"
484
+ }
485
+ ]
486
+ }
487
+ }
488
+ ]
489
+ },
490
+ "name_def": {
491
+ "type": "SEQ",
492
+ "members": [
493
+ {
494
+ "type": "FIELD",
495
+ "name": "number",
496
+ "content": {
497
+ "type": "CHOICE",
498
+ "members": [
499
+ {
500
+ "type": "SYMBOL",
501
+ "name": "num"
502
+ },
503
+ {
504
+ "type": "BLANK"
505
+ }
506
+ ]
507
+ }
508
+ },
509
+ {
510
+ "type": "FIELD",
511
+ "name": "surname",
512
+ "content": {
513
+ "type": "CHOICE",
514
+ "members": [
515
+ {
516
+ "type": "SYMBOL",
517
+ "name": "new_surname"
518
+ },
519
+ {
520
+ "type": "BLANK"
521
+ }
522
+ ]
523
+ }
524
+ },
525
+ {
526
+ "type": "FIELD",
527
+ "name": "name",
528
+ "content": {
529
+ "type": "SYMBOL",
530
+ "name": "name"
531
+ }
532
+ },
533
+ {
534
+ "type": "FIELD",
535
+ "name": "aliases",
536
+ "content": {
537
+ "type": "CHOICE",
538
+ "members": [
539
+ {
540
+ "type": "SYMBOL",
541
+ "name": "name_aliases"
542
+ },
543
+ {
544
+ "type": "BLANK"
545
+ }
546
+ ]
547
+ }
548
+ }
549
+ ]
550
+ },
551
+ "num": {
552
+ "type": "PATTERN",
553
+ "value": "\\d+[.)]?"
554
+ },
555
+ "new_surname": {
556
+ "type": "SEQ",
557
+ "members": [
558
+ {
559
+ "type": "STRING",
560
+ "value": "("
561
+ },
562
+ {
563
+ "type": "SYMBOL",
564
+ "name": "name"
565
+ },
566
+ {
567
+ "type": "STRING",
568
+ "value": ")"
569
+ }
570
+ ]
571
+ },
572
+ "name_aliases": {
573
+ "type": "SEQ",
574
+ "members": [
575
+ {
576
+ "type": "STRING",
577
+ "value": "("
578
+ },
579
+ {
580
+ "type": "CHOICE",
581
+ "members": [
582
+ {
583
+ "type": "SEQ",
584
+ "members": [
585
+ {
586
+ "type": "SYMBOL",
587
+ "name": "name"
588
+ },
589
+ {
590
+ "type": "CHOICE",
591
+ "members": [
592
+ {
593
+ "type": "REPEAT",
594
+ "content": {
595
+ "type": "SEQ",
596
+ "members": [
597
+ {
598
+ "type": "STRING",
599
+ "value": ","
600
+ },
601
+ {
602
+ "type": "SYMBOL",
603
+ "name": "name"
604
+ }
605
+ ]
606
+ }
607
+ },
608
+ {
609
+ "type": "BLANK"
610
+ }
611
+ ]
612
+ }
613
+ ]
614
+ },
615
+ {
616
+ "type": "BLANK"
617
+ }
618
+ ]
619
+ },
620
+ {
621
+ "type": "STRING",
622
+ "value": ")"
623
+ }
624
+ ]
625
+ },
626
+ "comment": {
627
+ "type": "SEQ",
628
+ "members": [
629
+ {
630
+ "type": "CHOICE",
631
+ "members": [
632
+ {
633
+ "type": "STRING",
634
+ "value": "*"
635
+ },
636
+ {
637
+ "type": "STRING",
638
+ "value": "/"
639
+ },
640
+ {
641
+ "type": "STRING",
642
+ "value": "#"
643
+ }
644
+ ]
645
+ },
646
+ {
647
+ "type": "CHOICE",
648
+ "members": [
649
+ {
650
+ "type": "PATTERN",
651
+ "value": "[^\\n]+"
652
+ },
653
+ {
654
+ "type": "BLANK"
655
+ }
656
+ ]
657
+ }
658
+ ]
659
+ },
660
+ "name": {
661
+ "type": "PATTERN",
662
+ "value": "\\p{Lu}[\\p{L}\\-\\d'\"]*",
663
+ "flags": "u"
664
+ },
665
+ "unknown": {
666
+ "type": "CHOICE",
667
+ "members": [
668
+ {
669
+ "type": "STRING",
670
+ "value": "?"
671
+ },
672
+ {
673
+ "type": "PATTERN",
674
+ "value": "\\p{L}[\\p{L}\\-\\d'\" ]*\\?",
675
+ "flags": "u"
676
+ }
677
+ ]
678
+ },
679
+ "num_unknown": {
680
+ "type": "SEQ",
681
+ "members": [
682
+ {
683
+ "type": "SYMBOL",
684
+ "name": "num"
685
+ },
686
+ {
687
+ "type": "SYMBOL",
688
+ "name": "unknown"
689
+ }
690
+ ]
691
+ },
692
+ "words": {
693
+ "type": "PATTERN",
694
+ "value": "\\p{Ll}([\\p{Ll}'\"\\s]*[\\p{Ll}'\"])?",
695
+ "flags": "u"
696
+ },
697
+ "_words": {
698
+ "type": "ALIAS",
699
+ "content": {
700
+ "type": "SYMBOL",
701
+ "name": "words"
702
+ },
703
+ "named": false,
704
+ "value": "_words"
705
+ },
706
+ "_arrows": {
707
+ "type": "CHOICE",
708
+ "members": [
709
+ {
710
+ "type": "STRING",
711
+ "value": "="
712
+ },
713
+ {
714
+ "type": "STRING",
715
+ "value": "<->"
716
+ },
717
+ {
718
+ "type": "STRING",
719
+ "value": "->"
720
+ },
721
+ {
722
+ "type": "STRING",
723
+ "value": "<-"
724
+ },
725
+ {
726
+ "type": "STRING",
727
+ "value": "-"
728
+ }
729
+ ]
730
+ }
731
+ },
732
+ "extras": [
733
+ {
734
+ "type": "STRING",
735
+ "value": " "
736
+ },
737
+ {
738
+ "type": "STRING",
739
+ "value": "\t"
740
+ }
741
+ ],
742
+ "conflicts": [
743
+ [
744
+ "family"
745
+ ],
746
+ [
747
+ "relations"
748
+ ],
749
+ [
750
+ "relation"
751
+ ],
752
+ [
753
+ "targets"
754
+ ]
755
+ ],
756
+ "precedences": [],
757
+ "externals": [],
758
+ "inline": [],
759
+ "supertypes": []
760
+ }