public
Description: A Ruby-based parsing DSL based on parsing expression grammars.
Homepage: http://treetop.rubyforge.org
Clone URL: git://github.com/nathansobo/treetop.git
Search Repo:
Inlined parsing of . symbol.
Nathan Sobo (author)
Sun Dec 09 21:41:50 -0800 2007
commit  966e871ad6c3ba7dc305dc834573d3db4706502e
tree    68b3a3c29c1a3c86a3e4221bed0b91a53e2bd424
parent  c5d15900e614382646736b2ed3c89d0ab16c9dfc
...
129
130
131
132
 
 
 
 
 
 
 
133
134
135
...
189
190
191
192
 
 
 
 
 
 
 
193
194
195
...
244
245
246
247
 
 
 
 
 
 
 
248
249
250
...
267
268
269
270
 
 
 
 
 
 
 
271
272
273
...
417
418
419
420
 
 
 
 
 
 
 
 
421
422
423
...
480
481
482
483
 
 
 
 
 
 
 
484
485
486
...
501
502
503
504
 
 
 
 
 
 
 
505
506
507
...
566
567
568
569
 
 
 
 
 
 
 
570
571
572
...
584
585
586
587
 
 
 
 
 
 
 
588
589
590
...
690
691
692
693
 
 
 
 
 
 
 
694
695
696
...
1158
1159
1160
1161
 
 
 
 
 
 
 
1162
1163
1164
...
1172
1173
1174
1175
 
 
 
 
 
 
 
 
1176
1177
1178
...
1337
1338
1339
1340
 
 
 
 
 
 
 
1341
1342
1343
...
1410
1411
1412
1413
 
 
 
 
 
 
 
1414
1415
1416
1417
 
 
 
 
 
 
 
1418
1419
1420
...
1437
1438
1439
1440
 
 
 
 
 
 
 
1441
1442
1443
1444
 
 
 
 
 
 
 
1445
1446
1447
...
1509
1510
1511
1512
 
 
 
 
 
 
 
1513
1514
1515
...
1531
1532
1533
1534
 
 
 
 
 
 
 
1535
1536
1537
...
1627
1628
1629
1630
 
1631
1632
1633
1634
 
1635
1636
1637
1638
 
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
 
 
1649
1650
1651
...
1655
1656
1657
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1658
1659
1660
1661
 
 
 
 
1662
1663
1664
...
1670
1671
1672
1673
 
 
 
 
 
 
 
1674
1675
1676
1677
1678
1679
1680
 
 
 
 
 
 
 
1681
1682
1683
...
1687
1688
1689
1690
 
 
 
 
 
 
 
1691
1692
1693
1694
 
 
 
 
 
 
 
1695
1696
1697
...
1722
1723
1724
1725
 
 
 
 
 
 
 
1726
1727
1728
...
1743
1744
1745
 
 
 
 
1746
1747
1748
...
1754
1755
1756
1757
 
 
 
 
 
 
 
1758
1759
1760
1761
1762
1763
1764
 
 
 
 
 
 
 
1765
1766
1767
...
1771
1772
1773
1774
 
 
 
 
 
 
 
1775
1776
1777
1778
 
 
 
 
 
 
 
1779
1780
1781
...
1806
1807
1808
1809
 
 
 
 
 
 
 
1810
1811
1812
...
1848
1849
1850
1851
 
 
 
 
 
 
 
1852
1853
1854
1855
1856
1857
1858
 
 
 
 
 
 
 
1859
1860
1861
...
1865
1866
1867
1868
 
 
 
 
 
 
 
1869
1870
1871
...
1900
1901
1902
1903
 
 
 
 
 
 
 
1904
1905
1906
...
1926
1927
1928
1929
 
 
 
 
 
 
 
1930
1931
1932
...
1968
1969
1970
1971
 
 
 
 
 
 
 
1972
1973
1974
1975
1976
1977
1978
 
 
 
 
 
 
 
1979
1980
1981
...
2008
2009
2010
2011
 
 
 
 
 
 
 
2012
2013
2014
...
2024
2025
2026
2027
 
 
 
 
 
 
 
 
2028
2029
2030
...
2099
2100
2101
2102
 
 
 
 
 
 
 
 
2103
2104
2105
...
2128
2129
2130
2131
 
 
 
 
 
 
 
2132
2133
2134
...
2180
2181
2182
2183
 
 
 
 
 
 
 
2184
2185
2186
...
2210
2211
2212
2213
 
 
 
 
 
 
 
2214
2215
2216
2217
 
 
 
 
 
 
 
2218
2219
2220
...
129
130
131
 
132
133
134
135
136
137
138
139
140
141
...
195
196
197
 
198
199
200
201
202
203
204
205
206
207
...
256
257
258
 
259
260
261
262
263
264
265
266
267
268
...
285
286
287
 
288
289
290
291
292
293
294
295
296
297
...
441
442
443
 
444
445
446
447
448
449
450
451
452
453
454
...
511
512
513
 
514
515
516
517
518
519
520
521
522
523
...
538
539
540
 
541
542
543
544
545
546
547
548
549
550
...
609
610
611
 
612
613
614
615
616
617
618
619
620
621
...
633
634
635
 
636
637
638
639
640
641
642
643
644
645
...
745
746
747
 
748
749
750
751
752
753
754
755
756
757
...
1219
1220
1221
 
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
...
1239
1240
1241
 
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
...
1411
1412
1413
 
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
...
1490
1491
1492
 
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
 
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
...
1529
1530
1531
 
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
 
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
...
1613
1614
1615
 
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
...
1641
1642
1643
 
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
...
1743
1744
1745
 
1746
1747
1748
1749
 
1750
1751
1752
1753
 
1754
1755
1756
1757
 
 
 
 
 
 
 
1758
1759
1760
1761
1762
...
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
...
1820
1821
1822
 
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
 
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
...
1849
1850
1851
 
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
 
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
...
1896
1897
1898
 
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
...
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
...
1938
1939
1940
 
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
 
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
...
1967
1968
1969
 
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
 
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
...
2014
2015
2016
 
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
...
2062
2063
2064
 
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
 
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
...
2091
2092
2093
 
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
...
2132
2133
2134
 
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
...
2164
2165
2166
 
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
...
2212
2213
2214
 
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
 
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
...
2264
2265
2266
 
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
...
2286
2287
2288
 
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
...
2368
2369
2370
 
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
...
2404
2405
2406
 
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
...
2462
2463
2464
 
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
...
2498
2499
2500
 
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
 
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
0
@@ -129,7 +129,13 @@ module Treetop
0
         
0
         i0, s0 = index, []
0
         i1, s1 = index, []
0
- r2 = parse_terminal('module', SyntaxNode)
0
+ if input.index('module', index) == index
0
+ r2 = (SyntaxNode).new(input, index...(index + 6))
0
+ @index += 6
0
+ else
0
+ terminal_parse_failure('module')
0
+ r2 = nil
0
+ end
0
         s1 << r2
0
         if r2
0
           r3 = _nt_space
0
@@ -189,7 +195,13 @@ module Treetop
0
             r12 = _nt_space
0
             s11 << r12
0
             if r12
0
- r13 = parse_terminal('end', SyntaxNode)
0
+ if input.index('end', index) == index
0
+ r13 = (SyntaxNode).new(input, index...(index + 3))
0
+ @index += 3
0
+ else
0
+ terminal_parse_failure('end')
0
+ r13 = nil
0
+ end
0
               s11 << r13
0
             end
0
             if s11.last
0
@@ -244,7 +256,13 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('grammar', SyntaxNode)
0
+ if input.index('grammar', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 7))
0
+ @index += 7
0
+ else
0
+ terminal_parse_failure('grammar')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           r2 = _nt_space
0
@@ -267,7 +285,13 @@ module Treetop
0
                   end
0
                   s0 << r6
0
                   if r6
0
- r8 = parse_terminal('end', SyntaxNode)
0
+ if input.index('end', index) == index
0
+ r8 = (SyntaxNode).new(input, index...(index + 3))
0
+ @index += 3
0
+ else
0
+ terminal_parse_failure('end')
0
+ r8 = nil
0
+ end
0
                     s0 << r8
0
                   end
0
                 end
0
@@ -417,7 +441,14 @@ module Treetop
0
         if r1
0
           r0 = r1
0
         else
0
- r7 = parse_terminal('', SyntaxNode, DeclarationSequence3)
0
+ if input.index('', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 0))
0
+ r7.extend(DeclarationSequence3)
0
+ @index += 0
0
+ else
0
+ terminal_parse_failure('')
0
+ r7 = nil
0
+ end
0
           if r7
0
             r0 = r7
0
           else
0
@@ -480,7 +511,13 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('include', SyntaxNode)
0
+ if input.index('include', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 7))
0
+ @index += 7
0
+ else
0
+ terminal_parse_failure('include')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           r2 = _nt_space
0
@@ -501,7 +538,13 @@ module Treetop
0
                 if r6
0
                   r5 = r6
0
                 else
0
- r7 = parse_terminal('::', SyntaxNode)
0
+ if input.index('::', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure('::')
0
+ r7 = nil
0
+ end
0
                   if r7
0
                     r5 = r7
0
                   else
0
@@ -566,7 +609,13 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('rule', SyntaxNode)
0
+ if input.index('rule', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 4))
0
+ @index += 4
0
+ else
0
+ terminal_parse_failure('rule')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           r2 = _nt_space
0
@@ -584,7 +633,13 @@ module Treetop
0
                   r6 = _nt_space
0
                   s0 << r6
0
                   if r6
0
- r7 = parse_terminal('end', SyntaxNode)
0
+ if input.index('end', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 3))
0
+ @index += 3
0
+ else
0
+ terminal_parse_failure('end')
0
+ r7 = nil
0
+ end
0
                     s0 << r7
0
                   end
0
                 end
0
@@ -690,7 +745,13 @@ module Treetop
0
             end
0
             s3 << r4
0
             if r4
0
- r6 = parse_terminal('/', SyntaxNode)
0
+ if input.index('/', index) == index
0
+ r6 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('/')
0
+ r6 = nil
0
+ end
0
               s3 << r6
0
               if r6
0
                 r8 = _nt_space
0
@@ -1158,7 +1219,13 @@ module Treetop
0
         end
0
         s1 << r2
0
         if r2
0
- r6 = parse_terminal(':', SyntaxNode)
0
+ if input.index(':', index) == index
0
+ r6 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure(':')
0
+ r6 = nil
0
+ end
0
           s1 << r6
0
         end
0
         if s1.last
0
@@ -1172,7 +1239,14 @@ module Treetop
0
         if r1
0
           r0 = r1
0
         else
0
- r7 = parse_terminal('', SyntaxNode, Label3)
0
+ if input.index('', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 0))
0
+ r7.extend(Label3)
0
+ @index += 0
0
+ else
0
+ terminal_parse_failure('')
0
+ r7 = nil
0
+ end
0
           if r7
0
             r0 = r7
0
           else
0
@@ -1337,7 +1411,13 @@ module Treetop
0
           return cached
0
         end
0
         
0
- r0 = parse_terminal('?', Optional)
0
+ if input.index('?', index) == index
0
+ r0 = (Optional).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('?')
0
+ r0 = nil
0
+ end
0
         
0
         node_cache[:optional_suffix][start_index] = r0
0
         
0
@@ -1410,11 +1490,23 @@ module Treetop
0
         end
0
         
0
         i0 = index
0
- r1 = parse_terminal('+', OneOrMore)
0
+ if input.index('+', index) == index
0
+ r1 = (OneOrMore).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('+')
0
+ r1 = nil
0
+ end
0
         if r1
0
           r0 = r1
0
         else
0
- r2 = parse_terminal('*', ZeroOrMore)
0
+ if input.index('*', index) == index
0
+ r2 = (ZeroOrMore).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('*')
0
+ r2 = nil
0
+ end
0
           if r2
0
             r0 = r2
0
           else
0
@@ -1437,11 +1529,23 @@ module Treetop
0
         end
0
         
0
         i0 = index
0
- r1 = parse_terminal('&', AndPredicate)
0
+ if input.index('&', index) == index
0
+ r1 = (AndPredicate).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('&')
0
+ r1 = nil
0
+ end
0
         if r1
0
           r0 = r1
0
         else
0
- r2 = parse_terminal('!', NotPredicate)
0
+ if input.index('!', index) == index
0
+ r2 = (NotPredicate).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('!')
0
+ r2 = nil
0
+ end
0
           if r2
0
             r0 = r2
0
           else
0
@@ -1509,7 +1613,13 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('(', SyntaxNode)
0
+ if input.index('(', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('(')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           r3 = _nt_space
0
@@ -1531,7 +1641,13 @@ module Treetop
0
               end
0
               s0 << r5
0
               if r5
0
- r7 = parse_terminal(')', SyntaxNode)
0
+ if input.index(')', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure(')')
0
+ r7 = nil
0
+ end
0
                 s0 << r7
0
               end
0
             end
0
@@ -1627,25 +1743,20 @@ module Treetop
0
         end
0
         
0
         i0 = index
0
- r1 = _nt_single_quoted_string
0
+ r1 = _nt_quoted_string
0
         if r1
0
           r0 = r1
0
         else
0
- r2 = _nt_double_quoted_string
0
+ r2 = _nt_character_class
0
           if r2
0
             r0 = r2
0
           else
0
- r3 = _nt_character_class
0
+ r3 = _nt_anything_symbol
0
             if r3
0
               r0 = r3
0
             else
0
- r4 = _nt_anything_symbol
0
- if r4
0
- r0 = r4
0
- else
0
- self.index = i0
0
- r0 = nil
0
- end
0
+ self.index = i0
0
+ r0 = nil
0
             end
0
           end
0
         end
0
@@ -1655,10 +1766,49 @@ module Treetop
0
         return r0
0
       end
0
       
0
+ module QuotedString0
0
+ def string
0
+ super.text_value
0
+ end
0
+ end
0
+
0
+ def _nt_quoted_string
0
+ start_index = index
0
+ cached = node_cache[:quoted_string][index]
0
+ if cached
0
+ @index = cached.interval.end
0
+ return cached
0
+ end
0
+
0
+ i0 = index
0
+ r1 = _nt_single_quoted_string
0
+ if r1
0
+ r0 = r1
0
+ r0.extend(QuotedString0)
0
+ else
0
+ r2 = _nt_double_quoted_string
0
+ if r2
0
+ r0 = r2
0
+ r0.extend(QuotedString0)
0
+ else
0
+ self.index = i0
0
+ r0 = nil
0
+ end
0
+ end
0
+
0
+ node_cache[:quoted_string][start_index] = r0
0
+
0
+ return r0
0
+ end
0
+
0
       module DoubleQuotedString0
0
       end
0
       
0
       module DoubleQuotedString1
0
+ def string
0
+ elements[1]
0
+ end
0
+
0
       end
0
       
0
       def _nt_double_quoted_string
0
@@ -1670,14 +1820,26 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('"', SyntaxNode)
0
+ if input.index('"', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('"')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           s2, i2 = [], index
0
           loop do
0
             i3, s3 = index, []
0
             i4 = index
0
- r5 = parse_terminal('"', SyntaxNode)
0
+ if input.index('"', index) == index
0
+ r5 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('"')
0
+ r5 = nil
0
+ end
0
             if r5
0
               r4 = nil
0
             else
0
@@ -1687,11 +1849,23 @@ module Treetop
0
             s3 << r4
0
             if r4
0
               i6 = index
0
- r7 = parse_terminal("\\\\", SyntaxNode)
0
+ if input.index("\\\\", index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure("\\\\")
0
+ r7 = nil
0
+ end
0
               if r7
0
                 r6 = r7
0
               else
0
- r8 = parse_terminal('\"', SyntaxNode)
0
+ if input.index('\"', index) == index
0
+ r8 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure('\"')
0
+ r8 = nil
0
+ end
0
                 if r8
0
                   r6 = r8
0
                 else
0
@@ -1722,7 +1896,13 @@ module Treetop
0
           r2 = SyntaxNode.new(input, i2...index, s2)
0
           s0 << r2
0
           if r2
0
- r10 = parse_terminal('"', SyntaxNode)
0
+ if input.index('"', index) == index
0
+ r10 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('"')
0
+ r10 = nil
0
+ end
0
             s0 << r10
0
           end
0
         end
0
@@ -1743,6 +1923,10 @@ module Treetop
0
       end
0
       
0
       module SingleQuotedString1
0
+ def string
0
+ elements[1]
0
+ end
0
+
0
       end
0
       
0
       def _nt_single_quoted_string
0
@@ -1754,14 +1938,26 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal("'", SyntaxNode)
0
+ if input.index("'", index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure("'")
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           s2, i2 = [], index
0
           loop do
0
             i3, s3 = index, []
0
             i4 = index
0
- r5 = parse_terminal("'", SyntaxNode)
0
+ if input.index("'", index) == index
0
+ r5 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure("'")
0
+ r5 = nil
0
+ end
0
             if r5
0
               r4 = nil
0
             else
0
@@ -1771,11 +1967,23 @@ module Treetop
0
             s3 << r4
0
             if r4
0
               i6 = index
0
- r7 = parse_terminal("\\\\", SyntaxNode)
0
+ if input.index("\\\\", index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure("\\\\")
0
+ r7 = nil
0
+ end
0
               if r7
0
                 r6 = r7
0
               else
0
- r8 = parse_terminal("\\'", SyntaxNode)
0
+ if input.index("\\'", index) == index
0
+ r8 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure("\\'")
0
+ r8 = nil
0
+ end
0
                 if r8
0
                   r6 = r8
0
                 else
0
@@ -1806,7 +2014,13 @@ module Treetop
0
           r2 = SyntaxNode.new(input, i2...index, s2)
0
           s0 << r2
0
           if r2
0
- r10 = parse_terminal("'", SyntaxNode)
0
+ if input.index("'", index) == index
0
+ r10 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure("'")
0
+ r10 = nil
0
+ end
0
             s0 << r10
0
           end
0
         end
0
@@ -1848,14 +2062,26 @@ module Treetop
0
         end
0
         
0
         i0, s0 = index, []
0
- r1 = parse_terminal('[', SyntaxNode)
0
+ if input.index('[', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure('[')
0
+ r1 = nil
0
+ end
0
         s0 << r1
0
         if r1
0
           s2, i2 = [], index
0
           loop do
0
             i3, s3 = index, []
0
             i4 = index
0
- r5 = parse_terminal(']', SyntaxNode)
0
+ if input.index(']', index) == index
0
+ r5 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure(']')
0
+ r5 = nil
0
+ end
0
             if r5
0
               r4 = nil
0
             else
0
@@ -1865,7 +2091,13 @@ module Treetop
0
             s3 << r4
0
             if r4
0
               i6 = index
0
- r7 = parse_terminal('\]', SyntaxNode)
0
+ if input.index('\]', index) == index
0
+ r7 = (SyntaxNode).new(input, index...(index + 2))
0
+ @index += 2
0
+ else
0
+ terminal_parse_failure('\]')
0
+ r7 = nil
0
+ end
0
               if r7
0
                 r6 = r7
0
               else
0
@@ -1900,7 +2132,13 @@ module Treetop
0
           end
0
           s0 << r2
0
           if r2
0
- r9 = parse_terminal(']', SyntaxNode)
0
+ if input.index(']', index) == index
0
+ r9 = (SyntaxNode).new(input, index...(index + 1))
0
+ @index += 1
0
+ else
0
+ terminal_parse_failure(']')
0
+ r9 = nil
0
+ end
0
             s0 << r9
0
           end
0
         end
0
@@ -1926,7 +2164,13 @@ module Treetop
0
           ret