tabry 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tabry/shells/bash.rb +12 -5
- data/sh/bash/README.md +2 -1
- data/tabry.gemspec +19 -2
- data/treesitter/Cargo.toml +26 -0
- data/treesitter/README.md +4 -0
- data/treesitter/binding.gyp +19 -0
- data/treesitter/bindings/node/binding.cc +28 -0
- data/treesitter/bindings/node/index.js +19 -0
- data/treesitter/bindings/rust/build.rs +40 -0
- data/treesitter/bindings/rust/lib.rs +52 -0
- data/treesitter/corpus/arg.txt +96 -0
- data/treesitter/corpus/at.txt +79 -0
- data/treesitter/corpus/comment.txt +13 -0
- data/treesitter/corpus/desc.txt +25 -0
- data/treesitter/corpus/examples_from_language_reference.txt +410 -0
- data/treesitter/corpus/flag.txt +48 -0
- data/treesitter/corpus/flag_desc_inline.txt +37 -0
- data/treesitter/corpus/opts.txt +21 -0
- data/treesitter/corpus/rapture.txt +61 -0
- data/treesitter/grammar.js +171 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/argument_titles.yml +8 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/arguments_and_possible_options__arg_.yml +23 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/flags__flag__flagarg__reqd_flagarg_.yml +37 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/getting_started.yml +13 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/includes.yml +57 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/multi_line_descriptions.yml +7 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/optional_args_and_varargs__opt_arg__varargs__opt_varargs_.yml +16 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/options.yml +24 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/subcommands__sub__1.yml +23 -0
- data/treesitter/jest_fixtures/examples_from_language_reference/subcommands__sub__2.yml +15 -0
- data/treesitter/package.json +21 -0
- data/treesitter/parser_compile.sh +1 -0
- data/treesitter/src/grammar.json +615 -0
- data/treesitter/src/node-types.json +563 -0
- data/treesitter/src/parser.c +4706 -0
- data/treesitter/src/tree_sitter/parser.h +223 -0
- data/treesitter/tabry-compile.js +394 -0
- data/treesitter/tabry-compile.test.js +51 -0
- metadata +36 -1
@@ -0,0 +1,615 @@
|
|
1
|
+
{
|
2
|
+
"name": "tabry",
|
3
|
+
"rules": {
|
4
|
+
"source_file": {
|
5
|
+
"type": "REPEAT",
|
6
|
+
"content": {
|
7
|
+
"type": "SYMBOL",
|
8
|
+
"name": "_toplevel_statement"
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"_toplevel_statement": {
|
12
|
+
"type": "CHOICE",
|
13
|
+
"members": [
|
14
|
+
{
|
15
|
+
"type": "SYMBOL",
|
16
|
+
"name": "_common_statement"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"type": "SYMBOL",
|
20
|
+
"name": "cmd_statement"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"type": "SYMBOL",
|
24
|
+
"name": "defopts_statement"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"type": "SYMBOL",
|
28
|
+
"name": "defargs_statement"
|
29
|
+
}
|
30
|
+
]
|
31
|
+
},
|
32
|
+
"_common_statement": {
|
33
|
+
"type": "CHOICE",
|
34
|
+
"members": [
|
35
|
+
{
|
36
|
+
"type": "SYMBOL",
|
37
|
+
"name": "arg_statement"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"type": "SYMBOL",
|
41
|
+
"name": "flagarg_statement"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"type": "SYMBOL",
|
45
|
+
"name": "flag_statement"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"type": "SYMBOL",
|
49
|
+
"name": "sub_statement"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"type": "SYMBOL",
|
53
|
+
"name": "_comment"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"type": "SYMBOL",
|
57
|
+
"name": "desc_statement"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"type": "SYMBOL",
|
61
|
+
"name": "include_statement"
|
62
|
+
}
|
63
|
+
]
|
64
|
+
},
|
65
|
+
"_block_statement": {
|
66
|
+
"type": "CHOICE",
|
67
|
+
"members": [
|
68
|
+
{
|
69
|
+
"type": "SYMBOL",
|
70
|
+
"name": "_common_statement"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"type": "SYMBOL",
|
74
|
+
"name": "opts_const_statement"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"type": "SYMBOL",
|
78
|
+
"name": "opts_shell_statement"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"type": "SYMBOL",
|
82
|
+
"name": "opts_file_statement"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"type": "SYMBOL",
|
86
|
+
"name": "opts_dir_statement"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"type": "SYMBOL",
|
90
|
+
"name": "title_statement"
|
91
|
+
}
|
92
|
+
]
|
93
|
+
},
|
94
|
+
"include_statement": {
|
95
|
+
"type": "SEQ",
|
96
|
+
"members": [
|
97
|
+
{
|
98
|
+
"type": "STRING",
|
99
|
+
"value": "include"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"type": "SYMBOL",
|
103
|
+
"name": "at_identifier"
|
104
|
+
}
|
105
|
+
]
|
106
|
+
},
|
107
|
+
"defopts_statement": {
|
108
|
+
"type": "SEQ",
|
109
|
+
"members": [
|
110
|
+
{
|
111
|
+
"type": "STRING",
|
112
|
+
"value": "defopts"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"type": "SYMBOL",
|
116
|
+
"name": "at_identifier"
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"type": "SYMBOL",
|
120
|
+
"name": "block"
|
121
|
+
}
|
122
|
+
]
|
123
|
+
},
|
124
|
+
"defargs_statement": {
|
125
|
+
"type": "SEQ",
|
126
|
+
"members": [
|
127
|
+
{
|
128
|
+
"type": "STRING",
|
129
|
+
"value": "defargs"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"type": "SYMBOL",
|
133
|
+
"name": "at_identifier"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"type": "SYMBOL",
|
137
|
+
"name": "block"
|
138
|
+
}
|
139
|
+
]
|
140
|
+
},
|
141
|
+
"at_identifier": {
|
142
|
+
"type": "PATTERN",
|
143
|
+
"value": "@[a-zA-Z_][a-zA-Z0-9_-]*"
|
144
|
+
},
|
145
|
+
"_comment": {
|
146
|
+
"type": "PATTERN",
|
147
|
+
"value": "#.*"
|
148
|
+
},
|
149
|
+
"sub_statement": {
|
150
|
+
"type": "SEQ",
|
151
|
+
"members": [
|
152
|
+
{
|
153
|
+
"type": "STRING",
|
154
|
+
"value": "sub"
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"type": "FIELD",
|
158
|
+
"name": "names",
|
159
|
+
"content": {
|
160
|
+
"type": "SYMBOL",
|
161
|
+
"name": "sub_name_list"
|
162
|
+
}
|
163
|
+
},
|
164
|
+
{
|
165
|
+
"type": "CHOICE",
|
166
|
+
"members": [
|
167
|
+
{
|
168
|
+
"type": "FIELD",
|
169
|
+
"name": "desc",
|
170
|
+
"content": {
|
171
|
+
"type": "SYMBOL",
|
172
|
+
"name": "string"
|
173
|
+
}
|
174
|
+
},
|
175
|
+
{
|
176
|
+
"type": "BLANK"
|
177
|
+
}
|
178
|
+
]
|
179
|
+
},
|
180
|
+
{
|
181
|
+
"type": "REPEAT",
|
182
|
+
"content": {
|
183
|
+
"type": "SYMBOL",
|
184
|
+
"name": "at_identifier"
|
185
|
+
}
|
186
|
+
},
|
187
|
+
{
|
188
|
+
"type": "CHOICE",
|
189
|
+
"members": [
|
190
|
+
{
|
191
|
+
"type": "SYMBOL",
|
192
|
+
"name": "block"
|
193
|
+
},
|
194
|
+
{
|
195
|
+
"type": "BLANK"
|
196
|
+
}
|
197
|
+
]
|
198
|
+
}
|
199
|
+
]
|
200
|
+
},
|
201
|
+
"cmd_statement": {
|
202
|
+
"type": "SEQ",
|
203
|
+
"members": [
|
204
|
+
{
|
205
|
+
"type": "STRING",
|
206
|
+
"value": "cmd"
|
207
|
+
},
|
208
|
+
{
|
209
|
+
"type": "SYMBOL",
|
210
|
+
"name": "string"
|
211
|
+
}
|
212
|
+
]
|
213
|
+
},
|
214
|
+
"desc_statement": {
|
215
|
+
"type": "SEQ",
|
216
|
+
"members": [
|
217
|
+
{
|
218
|
+
"type": "STRING",
|
219
|
+
"value": "desc"
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"type": "SYMBOL",
|
223
|
+
"name": "string"
|
224
|
+
}
|
225
|
+
]
|
226
|
+
},
|
227
|
+
"title_statement": {
|
228
|
+
"type": "SEQ",
|
229
|
+
"members": [
|
230
|
+
{
|
231
|
+
"type": "STRING",
|
232
|
+
"value": "title"
|
233
|
+
},
|
234
|
+
{
|
235
|
+
"type": "SYMBOL",
|
236
|
+
"name": "string"
|
237
|
+
}
|
238
|
+
]
|
239
|
+
},
|
240
|
+
"arg_type": {
|
241
|
+
"type": "CHOICE",
|
242
|
+
"members": [
|
243
|
+
{
|
244
|
+
"type": "STRING",
|
245
|
+
"value": "arg"
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"type": "STRING",
|
249
|
+
"value": "varargs"
|
250
|
+
}
|
251
|
+
]
|
252
|
+
},
|
253
|
+
"arg_statement": {
|
254
|
+
"type": "SEQ",
|
255
|
+
"members": [
|
256
|
+
{
|
257
|
+
"type": "CHOICE",
|
258
|
+
"members": [
|
259
|
+
{
|
260
|
+
"type": "SYMBOL",
|
261
|
+
"name": "arg_modifier"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"type": "BLANK"
|
265
|
+
}
|
266
|
+
]
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"type": "SYMBOL",
|
270
|
+
"name": "arg_type"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"type": "CHOICE",
|
274
|
+
"members": [
|
275
|
+
{
|
276
|
+
"type": "CHOICE",
|
277
|
+
"members": [
|
278
|
+
{
|
279
|
+
"type": "SEQ",
|
280
|
+
"members": [
|
281
|
+
{
|
282
|
+
"type": "SYMBOL",
|
283
|
+
"name": "arg_name_list"
|
284
|
+
},
|
285
|
+
{
|
286
|
+
"type": "SYMBOL",
|
287
|
+
"name": "string"
|
288
|
+
}
|
289
|
+
]
|
290
|
+
},
|
291
|
+
{
|
292
|
+
"type": "SEQ",
|
293
|
+
"members": [
|
294
|
+
{
|
295
|
+
"type": "SYMBOL",
|
296
|
+
"name": "arg_name_list"
|
297
|
+
}
|
298
|
+
]
|
299
|
+
}
|
300
|
+
]
|
301
|
+
},
|
302
|
+
{
|
303
|
+
"type": "BLANK"
|
304
|
+
}
|
305
|
+
]
|
306
|
+
},
|
307
|
+
{
|
308
|
+
"type": "REPEAT",
|
309
|
+
"content": {
|
310
|
+
"type": "FIELD",
|
311
|
+
"name": "at",
|
312
|
+
"content": {
|
313
|
+
"type": "SYMBOL",
|
314
|
+
"name": "at_identifier"
|
315
|
+
}
|
316
|
+
}
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"type": "CHOICE",
|
320
|
+
"members": [
|
321
|
+
{
|
322
|
+
"type": "SYMBOL",
|
323
|
+
"name": "block"
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"type": "BLANK"
|
327
|
+
}
|
328
|
+
]
|
329
|
+
}
|
330
|
+
]
|
331
|
+
},
|
332
|
+
"opts_const_statement": {
|
333
|
+
"type": "SEQ",
|
334
|
+
"members": [
|
335
|
+
{
|
336
|
+
"type": "STRING",
|
337
|
+
"value": "opts"
|
338
|
+
},
|
339
|
+
{
|
340
|
+
"type": "STRING",
|
341
|
+
"value": "const"
|
342
|
+
},
|
343
|
+
{
|
344
|
+
"type": "SYMBOL",
|
345
|
+
"name": "_strings"
|
346
|
+
}
|
347
|
+
]
|
348
|
+
},
|
349
|
+
"opts_shell_statement": {
|
350
|
+
"type": "SEQ",
|
351
|
+
"members": [
|
352
|
+
{
|
353
|
+
"type": "STRING",
|
354
|
+
"value": "opts"
|
355
|
+
},
|
356
|
+
{
|
357
|
+
"type": "STRING",
|
358
|
+
"value": "shell"
|
359
|
+
},
|
360
|
+
{
|
361
|
+
"type": "SYMBOL",
|
362
|
+
"name": "string"
|
363
|
+
}
|
364
|
+
]
|
365
|
+
},
|
366
|
+
"opts_file_statement": {
|
367
|
+
"type": "SEQ",
|
368
|
+
"members": [
|
369
|
+
{
|
370
|
+
"type": "STRING",
|
371
|
+
"value": "opts"
|
372
|
+
},
|
373
|
+
{
|
374
|
+
"type": "STRING",
|
375
|
+
"value": "file"
|
376
|
+
}
|
377
|
+
]
|
378
|
+
},
|
379
|
+
"opts_dir_statement": {
|
380
|
+
"type": "SEQ",
|
381
|
+
"members": [
|
382
|
+
{
|
383
|
+
"type": "STRING",
|
384
|
+
"value": "opts"
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"type": "STRING",
|
388
|
+
"value": "dir"
|
389
|
+
}
|
390
|
+
]
|
391
|
+
},
|
392
|
+
"flagarg_statement": {
|
393
|
+
"type": "SEQ",
|
394
|
+
"members": [
|
395
|
+
{
|
396
|
+
"type": "CHOICE",
|
397
|
+
"members": [
|
398
|
+
{
|
399
|
+
"type": "SYMBOL",
|
400
|
+
"name": "flag_modifier"
|
401
|
+
},
|
402
|
+
{
|
403
|
+
"type": "BLANK"
|
404
|
+
}
|
405
|
+
]
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"type": "STRING",
|
409
|
+
"value": "flagarg"
|
410
|
+
},
|
411
|
+
{
|
412
|
+
"type": "FIELD",
|
413
|
+
"name": "names",
|
414
|
+
"content": {
|
415
|
+
"type": "SYMBOL",
|
416
|
+
"name": "flag_name_list"
|
417
|
+
}
|
418
|
+
},
|
419
|
+
{
|
420
|
+
"type": "CHOICE",
|
421
|
+
"members": [
|
422
|
+
{
|
423
|
+
"type": "FIELD",
|
424
|
+
"name": "desc",
|
425
|
+
"content": {
|
426
|
+
"type": "SYMBOL",
|
427
|
+
"name": "string"
|
428
|
+
}
|
429
|
+
},
|
430
|
+
{
|
431
|
+
"type": "BLANK"
|
432
|
+
}
|
433
|
+
]
|
434
|
+
},
|
435
|
+
{
|
436
|
+
"type": "REPEAT",
|
437
|
+
"content": {
|
438
|
+
"type": "SYMBOL",
|
439
|
+
"name": "at_identifier"
|
440
|
+
}
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"type": "CHOICE",
|
444
|
+
"members": [
|
445
|
+
{
|
446
|
+
"type": "SYMBOL",
|
447
|
+
"name": "block"
|
448
|
+
},
|
449
|
+
{
|
450
|
+
"type": "BLANK"
|
451
|
+
}
|
452
|
+
]
|
453
|
+
}
|
454
|
+
]
|
455
|
+
},
|
456
|
+
"flag_statement": {
|
457
|
+
"type": "SEQ",
|
458
|
+
"members": [
|
459
|
+
{
|
460
|
+
"type": "CHOICE",
|
461
|
+
"members": [
|
462
|
+
{
|
463
|
+
"type": "SYMBOL",
|
464
|
+
"name": "flag_modifier"
|
465
|
+
},
|
466
|
+
{
|
467
|
+
"type": "BLANK"
|
468
|
+
}
|
469
|
+
]
|
470
|
+
},
|
471
|
+
{
|
472
|
+
"type": "STRING",
|
473
|
+
"value": "flag"
|
474
|
+
},
|
475
|
+
{
|
476
|
+
"type": "FIELD",
|
477
|
+
"name": "names",
|
478
|
+
"content": {
|
479
|
+
"type": "SYMBOL",
|
480
|
+
"name": "flag_name_list"
|
481
|
+
}
|
482
|
+
},
|
483
|
+
{
|
484
|
+
"type": "CHOICE",
|
485
|
+
"members": [
|
486
|
+
{
|
487
|
+
"type": "FIELD",
|
488
|
+
"name": "desc",
|
489
|
+
"content": {
|
490
|
+
"type": "SYMBOL",
|
491
|
+
"name": "string"
|
492
|
+
}
|
493
|
+
},
|
494
|
+
{
|
495
|
+
"type": "BLANK"
|
496
|
+
}
|
497
|
+
]
|
498
|
+
},
|
499
|
+
{
|
500
|
+
"type": "REPEAT",
|
501
|
+
"content": {
|
502
|
+
"type": "SYMBOL",
|
503
|
+
"name": "at_identifier"
|
504
|
+
}
|
505
|
+
},
|
506
|
+
{
|
507
|
+
"type": "CHOICE",
|
508
|
+
"members": [
|
509
|
+
{
|
510
|
+
"type": "SYMBOL",
|
511
|
+
"name": "block"
|
512
|
+
},
|
513
|
+
{
|
514
|
+
"type": "BLANK"
|
515
|
+
}
|
516
|
+
]
|
517
|
+
}
|
518
|
+
]
|
519
|
+
},
|
520
|
+
"flag_modifier": {
|
521
|
+
"type": "CHOICE",
|
522
|
+
"members": [
|
523
|
+
{
|
524
|
+
"type": "STRING",
|
525
|
+
"value": "reqd"
|
526
|
+
}
|
527
|
+
]
|
528
|
+
},
|
529
|
+
"arg_modifier": {
|
530
|
+
"type": "STRING",
|
531
|
+
"value": "opt"
|
532
|
+
},
|
533
|
+
"block": {
|
534
|
+
"type": "SEQ",
|
535
|
+
"members": [
|
536
|
+
{
|
537
|
+
"type": "STRING",
|
538
|
+
"value": "{"
|
539
|
+
},
|
540
|
+
{
|
541
|
+
"type": "REPEAT1",
|
542
|
+
"content": {
|
543
|
+
"type": "SYMBOL",
|
544
|
+
"name": "_block_statement"
|
545
|
+
}
|
546
|
+
},
|
547
|
+
{
|
548
|
+
"type": "STRING",
|
549
|
+
"value": "}"
|
550
|
+
}
|
551
|
+
]
|
552
|
+
},
|
553
|
+
"flag_name_list": {
|
554
|
+
"type": "SYMBOL",
|
555
|
+
"name": "_strings"
|
556
|
+
},
|
557
|
+
"arg_name_list": {
|
558
|
+
"type": "SYMBOL",
|
559
|
+
"name": "_strings"
|
560
|
+
},
|
561
|
+
"sub_name_list": {
|
562
|
+
"type": "SYMBOL",
|
563
|
+
"name": "_strings"
|
564
|
+
},
|
565
|
+
"_strings": {
|
566
|
+
"type": "CHOICE",
|
567
|
+
"members": [
|
568
|
+
{
|
569
|
+
"type": "SYMBOL",
|
570
|
+
"name": "string"
|
571
|
+
},
|
572
|
+
{
|
573
|
+
"type": "SYMBOL",
|
574
|
+
"name": "_strings_list"
|
575
|
+
}
|
576
|
+
]
|
577
|
+
},
|
578
|
+
"string": {
|
579
|
+
"type": "PATTERN",
|
580
|
+
"value": "[A-Za-z_][a-zA-Z0-9_,-]*|\"([^\"\\\\]|\\\\\"|\\\\\\\\)*\""
|
581
|
+
},
|
582
|
+
"_strings_list": {
|
583
|
+
"type": "SEQ",
|
584
|
+
"members": [
|
585
|
+
{
|
586
|
+
"type": "STRING",
|
587
|
+
"value": "("
|
588
|
+
},
|
589
|
+
{
|
590
|
+
"type": "REPEAT1",
|
591
|
+
"content": {
|
592
|
+
"type": "SYMBOL",
|
593
|
+
"name": "string"
|
594
|
+
}
|
595
|
+
},
|
596
|
+
{
|
597
|
+
"type": "STRING",
|
598
|
+
"value": ")"
|
599
|
+
}
|
600
|
+
]
|
601
|
+
}
|
602
|
+
},
|
603
|
+
"extras": [
|
604
|
+
{
|
605
|
+
"type": "PATTERN",
|
606
|
+
"value": "\\s"
|
607
|
+
}
|
608
|
+
],
|
609
|
+
"conflicts": [],
|
610
|
+
"precedences": [],
|
611
|
+
"externals": [],
|
612
|
+
"inline": [],
|
613
|
+
"supertypes": []
|
614
|
+
}
|
615
|
+
|