citrus 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +12 -0
- data/README +3 -3
- data/Rakefile +1 -1
- data/benchmark/after.dat +192 -0
- data/benchmark/before.dat +192 -0
- data/examples/calc.citrus +13 -41
- data/examples/{calc.rb → calc_test.rb} +0 -0
- data/examples/calc_test.rbc +2268 -0
- data/examples/{ipaddress.rb → ipaddress_test.rb} +0 -0
- data/examples/ipaddress_test.rbc +515 -0
- data/examples/{ipv4address.rb → ipv4address_test.rb} +0 -0
- data/examples/ipv4address_test.rbc +1112 -0
- data/examples/{ipv6address.rb → ipv6address_test.rb} +0 -0
- data/examples/ipv6address_test.rbc +1195 -0
- data/lib/citrus.rb +26 -23
- data/lib/citrus/file.rb +8 -8
- data/lib/citrus/version.rb +1 -1
- data/test/_files/grammar3.citrus +8 -0
- data/test/alias_test.rbc +1491 -0
- data/test/and_predicate_test.rbc +1327 -0
- data/test/but_predicate_test.rbc +1398 -0
- data/test/choice_test.rbc +1278 -0
- data/test/extension_test.rbc +1121 -0
- data/test/file_test.rbc +21465 -0
- data/test/grammar_test.rbc +3490 -0
- data/test/helper.rbc +1046 -0
- data/test/input_test.rbc +1775 -0
- data/test/label_test.rbc +692 -0
- data/test/match_test.rbc +2415 -0
- data/test/memoized_input_test.rbc +1124 -0
- data/test/multibyte_test.rbc +1597 -0
- data/test/not_predicate_test.rbc +1327 -0
- data/test/parse_error_test.rbc +1253 -0
- data/test/repeat_test.rbc +3245 -0
- data/test/sequence_test.rbc +1534 -0
- data/test/string_terminal_test.rbc +1802 -0
- data/test/super_test.rbc +2083 -0
- data/test/terminal_test.rbc +1315 -0
- metadata +59 -25
data/test/label_test.rbc
ADDED
@@ -0,0 +1,692 @@
|
|
1
|
+
!RBIX
|
2
|
+
0
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
54
|
13
|
+
5
|
14
|
+
45
|
15
|
+
0
|
16
|
+
1
|
17
|
+
7
|
18
|
+
2
|
19
|
+
64
|
20
|
+
65
|
21
|
+
49
|
22
|
+
3
|
23
|
+
0
|
24
|
+
49
|
25
|
+
4
|
26
|
+
2
|
27
|
+
47
|
28
|
+
49
|
29
|
+
5
|
30
|
+
1
|
31
|
+
15
|
32
|
+
99
|
33
|
+
7
|
34
|
+
6
|
35
|
+
45
|
36
|
+
7
|
37
|
+
8
|
38
|
+
43
|
39
|
+
9
|
40
|
+
43
|
41
|
+
10
|
42
|
+
65
|
43
|
+
49
|
44
|
+
11
|
45
|
+
3
|
46
|
+
13
|
47
|
+
99
|
48
|
+
12
|
49
|
+
7
|
50
|
+
12
|
51
|
+
12
|
52
|
+
7
|
53
|
+
13
|
54
|
+
12
|
55
|
+
65
|
56
|
+
12
|
57
|
+
49
|
58
|
+
14
|
59
|
+
4
|
60
|
+
15
|
61
|
+
49
|
62
|
+
12
|
63
|
+
0
|
64
|
+
15
|
65
|
+
2
|
66
|
+
11
|
67
|
+
I
|
68
|
+
6
|
69
|
+
I
|
70
|
+
0
|
71
|
+
I
|
72
|
+
0
|
73
|
+
I
|
74
|
+
0
|
75
|
+
n
|
76
|
+
p
|
77
|
+
15
|
78
|
+
x
|
79
|
+
4
|
80
|
+
File
|
81
|
+
n
|
82
|
+
s
|
83
|
+
9
|
84
|
+
../helper
|
85
|
+
x
|
86
|
+
11
|
87
|
+
active_path
|
88
|
+
x
|
89
|
+
11
|
90
|
+
expand_path
|
91
|
+
x
|
92
|
+
7
|
93
|
+
require
|
94
|
+
x
|
95
|
+
9
|
96
|
+
LabelTest
|
97
|
+
x
|
98
|
+
4
|
99
|
+
Test
|
100
|
+
n
|
101
|
+
x
|
102
|
+
4
|
103
|
+
Unit
|
104
|
+
x
|
105
|
+
8
|
106
|
+
TestCase
|
107
|
+
x
|
108
|
+
10
|
109
|
+
open_class
|
110
|
+
x
|
111
|
+
14
|
112
|
+
__class_init__
|
113
|
+
M
|
114
|
+
1
|
115
|
+
n
|
116
|
+
n
|
117
|
+
x
|
118
|
+
9
|
119
|
+
LabelTest
|
120
|
+
i
|
121
|
+
44
|
122
|
+
5
|
123
|
+
66
|
124
|
+
99
|
125
|
+
7
|
126
|
+
0
|
127
|
+
7
|
128
|
+
1
|
129
|
+
65
|
130
|
+
67
|
131
|
+
49
|
132
|
+
2
|
133
|
+
0
|
134
|
+
49
|
135
|
+
3
|
136
|
+
4
|
137
|
+
15
|
138
|
+
99
|
139
|
+
7
|
140
|
+
4
|
141
|
+
7
|
142
|
+
5
|
143
|
+
65
|
144
|
+
67
|
145
|
+
49
|
146
|
+
2
|
147
|
+
0
|
148
|
+
49
|
149
|
+
3
|
150
|
+
4
|
151
|
+
15
|
152
|
+
99
|
153
|
+
7
|
154
|
+
6
|
155
|
+
7
|
156
|
+
7
|
157
|
+
65
|
158
|
+
67
|
159
|
+
49
|
160
|
+
2
|
161
|
+
0
|
162
|
+
49
|
163
|
+
3
|
164
|
+
4
|
165
|
+
11
|
166
|
+
I
|
167
|
+
5
|
168
|
+
I
|
169
|
+
0
|
170
|
+
I
|
171
|
+
0
|
172
|
+
I
|
173
|
+
0
|
174
|
+
n
|
175
|
+
p
|
176
|
+
8
|
177
|
+
x
|
178
|
+
9
|
179
|
+
test_to_s
|
180
|
+
M
|
181
|
+
1
|
182
|
+
n
|
183
|
+
n
|
184
|
+
x
|
185
|
+
9
|
186
|
+
test_to_s
|
187
|
+
i
|
188
|
+
39
|
189
|
+
45
|
190
|
+
0
|
191
|
+
1
|
192
|
+
7
|
193
|
+
2
|
194
|
+
64
|
195
|
+
49
|
196
|
+
3
|
197
|
+
1
|
198
|
+
19
|
199
|
+
0
|
200
|
+
15
|
201
|
+
20
|
202
|
+
0
|
203
|
+
7
|
204
|
+
4
|
205
|
+
64
|
206
|
+
13
|
207
|
+
18
|
208
|
+
2
|
209
|
+
49
|
210
|
+
5
|
211
|
+
1
|
212
|
+
15
|
213
|
+
15
|
214
|
+
5
|
215
|
+
7
|
216
|
+
6
|
217
|
+
64
|
218
|
+
20
|
219
|
+
0
|
220
|
+
49
|
221
|
+
7
|
222
|
+
0
|
223
|
+
47
|
224
|
+
49
|
225
|
+
8
|
226
|
+
2
|
227
|
+
11
|
228
|
+
I
|
229
|
+
4
|
230
|
+
I
|
231
|
+
1
|
232
|
+
I
|
233
|
+
0
|
234
|
+
I
|
235
|
+
0
|
236
|
+
n
|
237
|
+
p
|
238
|
+
9
|
239
|
+
x
|
240
|
+
4
|
241
|
+
Rule
|
242
|
+
n
|
243
|
+
s
|
244
|
+
1
|
245
|
+
a
|
246
|
+
x
|
247
|
+
3
|
248
|
+
for
|
249
|
+
s
|
250
|
+
7
|
251
|
+
a_label
|
252
|
+
x
|
253
|
+
6
|
254
|
+
label=
|
255
|
+
s
|
256
|
+
11
|
257
|
+
a_label:"a"
|
258
|
+
x
|
259
|
+
4
|
260
|
+
to_s
|
261
|
+
x
|
262
|
+
12
|
263
|
+
assert_equal
|
264
|
+
p
|
265
|
+
9
|
266
|
+
I
|
267
|
+
0
|
268
|
+
I
|
269
|
+
4
|
270
|
+
I
|
271
|
+
0
|
272
|
+
I
|
273
|
+
5
|
274
|
+
I
|
275
|
+
c
|
276
|
+
I
|
277
|
+
6
|
278
|
+
I
|
279
|
+
19
|
280
|
+
I
|
281
|
+
7
|
282
|
+
I
|
283
|
+
27
|
284
|
+
x
|
285
|
+
49
|
286
|
+
/Users/michael/Projects/citrus/test/label_test.rb
|
287
|
+
p
|
288
|
+
1
|
289
|
+
x
|
290
|
+
4
|
291
|
+
rule
|
292
|
+
x
|
293
|
+
17
|
294
|
+
method_visibility
|
295
|
+
x
|
296
|
+
15
|
297
|
+
add_defn_method
|
298
|
+
x
|
299
|
+
18
|
300
|
+
test_to_s_sequence
|
301
|
+
M
|
302
|
+
1
|
303
|
+
n
|
304
|
+
n
|
305
|
+
x
|
306
|
+
18
|
307
|
+
test_to_s_sequence
|
308
|
+
i
|
309
|
+
70
|
310
|
+
45
|
311
|
+
0
|
312
|
+
1
|
313
|
+
13
|
314
|
+
71
|
315
|
+
2
|
316
|
+
47
|
317
|
+
9
|
318
|
+
29
|
319
|
+
47
|
320
|
+
49
|
321
|
+
3
|
322
|
+
0
|
323
|
+
13
|
324
|
+
7
|
325
|
+
4
|
326
|
+
64
|
327
|
+
7
|
328
|
+
5
|
329
|
+
64
|
330
|
+
35
|
331
|
+
2
|
332
|
+
47
|
333
|
+
49
|
334
|
+
6
|
335
|
+
1
|
336
|
+
15
|
337
|
+
8
|
338
|
+
40
|
339
|
+
7
|
340
|
+
4
|
341
|
+
64
|
342
|
+
7
|
343
|
+
5
|
344
|
+
64
|
345
|
+
35
|
346
|
+
2
|
347
|
+
49
|
348
|
+
2
|
349
|
+
1
|
350
|
+
19
|
351
|
+
0
|
352
|
+
15
|
353
|
+
20
|
354
|
+
0
|
355
|
+
7
|
356
|
+
7
|
357
|
+
64
|
358
|
+
13
|
359
|
+
18
|
360
|
+
2
|
361
|
+
49
|
362
|
+
8
|
363
|
+
1
|
364
|
+
15
|
365
|
+
15
|
366
|
+
5
|
367
|
+
7
|
368
|
+
9
|
369
|
+
64
|
370
|
+
20
|
371
|
+
0
|
372
|
+
49
|
373
|
+
10
|
374
|
+
0
|
375
|
+
47
|
376
|
+
49
|
377
|
+
11
|
378
|
+
2
|
379
|
+
11
|
380
|
+
I
|
381
|
+
5
|
382
|
+
I
|
383
|
+
1
|
384
|
+
I
|
385
|
+
0
|
386
|
+
I
|
387
|
+
0
|
388
|
+
n
|
389
|
+
p
|
390
|
+
12
|
391
|
+
x
|
392
|
+
8
|
393
|
+
Sequence
|
394
|
+
n
|
395
|
+
x
|
396
|
+
3
|
397
|
+
new
|
398
|
+
x
|
399
|
+
8
|
400
|
+
allocate
|
401
|
+
s
|
402
|
+
1
|
403
|
+
a
|
404
|
+
s
|
405
|
+
1
|
406
|
+
b
|
407
|
+
x
|
408
|
+
10
|
409
|
+
initialize
|
410
|
+
s
|
411
|
+
7
|
412
|
+
s_label
|
413
|
+
x
|
414
|
+
6
|
415
|
+
label=
|
416
|
+
s
|
417
|
+
17
|
418
|
+
s_label:("a" "b")
|
419
|
+
x
|
420
|
+
4
|
421
|
+
to_s
|
422
|
+
x
|
423
|
+
12
|
424
|
+
assert_equal
|
425
|
+
p
|
426
|
+
9
|
427
|
+
I
|
428
|
+
0
|
429
|
+
I
|
430
|
+
a
|
431
|
+
I
|
432
|
+
0
|
433
|
+
I
|
434
|
+
b
|
435
|
+
I
|
436
|
+
2b
|
437
|
+
I
|
438
|
+
c
|
439
|
+
I
|
440
|
+
38
|
441
|
+
I
|
442
|
+
d
|
443
|
+
I
|
444
|
+
46
|
445
|
+
x
|
446
|
+
49
|
447
|
+
/Users/michael/Projects/citrus/test/label_test.rb
|
448
|
+
p
|
449
|
+
1
|
450
|
+
x
|
451
|
+
4
|
452
|
+
rule
|
453
|
+
x
|
454
|
+
18
|
455
|
+
test_to_s_embedded
|
456
|
+
M
|
457
|
+
1
|
458
|
+
n
|
459
|
+
n
|
460
|
+
x
|
461
|
+
18
|
462
|
+
test_to_s_embedded
|
463
|
+
i
|
464
|
+
93
|
465
|
+
45
|
466
|
+
0
|
467
|
+
1
|
468
|
+
7
|
469
|
+
2
|
470
|
+
64
|
471
|
+
49
|
472
|
+
3
|
473
|
+
1
|
474
|
+
19
|
475
|
+
0
|
476
|
+
15
|
477
|
+
20
|
478
|
+
0
|
479
|
+
7
|
480
|
+
4
|
481
|
+
64
|
482
|
+
13
|
483
|
+
18
|
484
|
+
2
|
485
|
+
49
|
486
|
+
5
|
487
|
+
1
|
488
|
+
15
|
489
|
+
15
|
490
|
+
45
|
491
|
+
6
|
492
|
+
7
|
493
|
+
13
|
494
|
+
71
|
495
|
+
8
|
496
|
+
47
|
497
|
+
9
|
498
|
+
53
|
499
|
+
47
|
500
|
+
49
|
501
|
+
9
|
502
|
+
0
|
503
|
+
13
|
504
|
+
20
|
505
|
+
0
|
506
|
+
7
|
507
|
+
10
|
508
|
+
64
|
509
|
+
35
|
510
|
+
2
|
511
|
+
47
|
512
|
+
49
|
513
|
+
11
|
514
|
+
1
|
515
|
+
15
|
516
|
+
8
|
517
|
+
63
|
518
|
+
20
|
519
|
+
0
|
520
|
+
7
|
521
|
+
10
|
522
|
+
64
|
523
|
+
35
|
524
|
+
2
|
525
|
+
49
|
526
|
+
8
|
527
|
+
1
|
528
|
+
19
|
529
|
+
1
|
530
|
+
15
|
531
|
+
20
|
532
|
+
1
|
533
|
+
7
|
534
|
+
12
|
535
|
+
64
|
536
|
+
13
|
537
|
+
18
|
538
|
+
2
|
539
|
+
49
|
540
|
+
5
|
541
|
+
1
|
542
|
+
15
|
543
|
+
15
|
544
|
+
5
|
545
|
+
7
|
546
|
+
13
|
547
|
+
64
|
548
|
+
20
|
549
|
+
1
|
550
|
+
49
|
551
|
+
14
|
552
|
+
0
|
553
|
+
47
|
554
|
+
49
|
555
|
+
15
|
556
|
+
2
|
557
|
+
11
|
558
|
+
I
|
559
|
+
6
|
560
|
+
I
|
561
|
+
2
|
562
|
+
I
|
563
|
+
0
|
564
|
+
I
|
565
|
+
0
|
566
|
+
n
|
567
|
+
p
|
568
|
+
16
|
569
|
+
x
|
570
|
+
4
|
571
|
+
Rule
|
572
|
+
n
|
573
|
+
s
|
574
|
+
1
|
575
|
+
a
|
576
|
+
x
|
577
|
+
3
|
578
|
+
for
|
579
|
+
s
|
580
|
+
7
|
581
|
+
a_label
|
582
|
+
x
|
583
|
+
6
|
584
|
+
label=
|
585
|
+
x
|
586
|
+
8
|
587
|
+
Sequence
|
588
|
+
n
|
589
|
+
x
|
590
|
+
3
|
591
|
+
new
|
592
|
+
x
|
593
|
+
8
|
594
|
+
allocate
|
595
|
+
s
|
596
|
+
1
|
597
|
+
b
|
598
|
+
x
|
599
|
+
10
|
600
|
+
initialize
|
601
|
+
s
|
602
|
+
7
|
603
|
+
s_label
|
604
|
+
s
|
605
|
+
25
|
606
|
+
s_label:(a_label:"a" "b")
|
607
|
+
x
|
608
|
+
4
|
609
|
+
to_s
|
610
|
+
x
|
611
|
+
12
|
612
|
+
assert_equal
|
613
|
+
p
|
614
|
+
13
|
615
|
+
I
|
616
|
+
0
|
617
|
+
I
|
618
|
+
10
|
619
|
+
I
|
620
|
+
0
|
621
|
+
I
|
622
|
+
11
|
623
|
+
I
|
624
|
+
c
|
625
|
+
I
|
626
|
+
12
|
627
|
+
I
|
628
|
+
19
|
629
|
+
I
|
630
|
+
13
|
631
|
+
I
|
632
|
+
42
|
633
|
+
I
|
634
|
+
14
|
635
|
+
I
|
636
|
+
4f
|
637
|
+
I
|
638
|
+
15
|
639
|
+
I
|
640
|
+
5d
|
641
|
+
x
|
642
|
+
49
|
643
|
+
/Users/michael/Projects/citrus/test/label_test.rb
|
644
|
+
p
|
645
|
+
2
|
646
|
+
x
|
647
|
+
1
|
648
|
+
a
|
649
|
+
x
|
650
|
+
4
|
651
|
+
rule
|
652
|
+
p
|
653
|
+
7
|
654
|
+
I
|
655
|
+
2
|
656
|
+
I
|
657
|
+
4
|
658
|
+
I
|
659
|
+
10
|
660
|
+
I
|
661
|
+
a
|
662
|
+
I
|
663
|
+
1e
|
664
|
+
I
|
665
|
+
10
|
666
|
+
I
|
667
|
+
2c
|
668
|
+
x
|
669
|
+
49
|
670
|
+
/Users/michael/Projects/citrus/test/label_test.rb
|
671
|
+
p
|
672
|
+
0
|
673
|
+
x
|
674
|
+
13
|
675
|
+
attach_method
|
676
|
+
p
|
677
|
+
5
|
678
|
+
I
|
679
|
+
0
|
680
|
+
I
|
681
|
+
1
|
682
|
+
I
|
683
|
+
13
|
684
|
+
I
|
685
|
+
3
|
686
|
+
I
|
687
|
+
36
|
688
|
+
x
|
689
|
+
49
|
690
|
+
/Users/michael/Projects/citrus/test/label_test.rb
|
691
|
+
p
|
692
|
+
0
|