regexp_parser 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/regexp_parser/scanner/scanner.rl +7 -0
- data/lib/regexp_parser/scanner.rb +95 -78
- data/lib/regexp_parser/version.rb +1 -1
- data/regexp_parser.gemspec +3 -5
- metadata +6 -8
- data/CHANGELOG.md +0 -691
- data/README.md +0 -506
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5309aa54a7dc49b910246ad7efd9bf1e2f6b19917c41f2c4dd389568c7a1d0c5
|
4
|
+
data.tar.gz: 0174ec36fcec3ca3696f7e5fbe2eeaa5e9d75b09d4e0891bd841da997101f123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b52cfb89d0cb55c63844fe5f808c8472c2987746e33d71fe2ede2b9759d3f572611679050a0ae407a391c0f2ba88e9049beb579c2ead9c037b711c9a0c62b18b
|
7
|
+
data.tar.gz: 708e81a6463887e849ed1c560eb36abae556dc7b87c1f3fac30f74b1822a778b7d711c2fbba52ad9114db1ee5ba3a47f3898d17023de97b56799aed891e34c7f
|
@@ -267,6 +267,13 @@
|
|
267
267
|
fret;
|
268
268
|
};
|
269
269
|
|
270
|
+
[8-9] . [0-9] { # special case, emits two tokens
|
271
|
+
text = copy(data, ts-1, te)
|
272
|
+
emit(:escape, :literal, text[0, 2])
|
273
|
+
emit(:literal, :literal, text[2])
|
274
|
+
fret;
|
275
|
+
};
|
276
|
+
|
270
277
|
meta_char {
|
271
278
|
case text = copy(data, ts-1, te)
|
272
279
|
when '\.'; emit(:escape, :dot, text)
|
@@ -85,12 +85,12 @@ self._re_scanner_trans_keys = [
|
|
85
85
|
48,120,48,55,48,55,
|
86
86
|
-62,125,-128,-65,-128,
|
87
87
|
-65,-128,-65,48,55,
|
88
|
-
48,55,77,77,
|
89
|
-
0,0,67,
|
90
|
-
45,0,0,
|
91
|
-
48,102,39,60,
|
92
|
-
|
93
|
-
62,0
|
88
|
+
48,55,48,57,77,77,
|
89
|
+
45,45,0,0,67,
|
90
|
+
99,45,45,0,0,
|
91
|
+
92,92,48,102,39,60,
|
92
|
+
39,57,48,57,41,
|
93
|
+
57,33,62,0
|
94
94
|
]
|
95
95
|
|
96
96
|
class << self
|
@@ -111,8 +111,8 @@ self._re_scanner_key_spans = [
|
|
111
111
|
94,1,21,21,21,58,14,52,
|
112
112
|
33,188,64,64,64,1,56,1,
|
113
113
|
73,8,8,188,64,64,64,8,
|
114
|
-
8,1,1,0,33,1,0,
|
115
|
-
55,22,19,10,17,30
|
114
|
+
8,10,1,1,0,33,1,0,
|
115
|
+
1,55,22,19,10,17,30
|
116
116
|
]
|
117
117
|
|
118
118
|
class << self
|
@@ -133,8 +133,8 @@ self._re_scanner_index_offsets = [
|
|
133
133
|
3415,3510,3512,3534,3556,3578,3637,3652,
|
134
134
|
3705,3739,3928,3993,4058,4123,4125,4182,
|
135
135
|
4184,4258,4267,4276,4465,4530,4595,4660,
|
136
|
-
4669,4678,
|
137
|
-
|
136
|
+
4669,4678,4689,4691,4693,4694,4728,4730,
|
137
|
+
4731,4733,4789,4812,4832,4843,4861
|
138
138
|
]
|
139
139
|
|
140
140
|
class << self
|
@@ -726,33 +726,34 @@ self._re_scanner_indicies = [
|
|
726
726
|
176,176,176,176,176,176,176,176,
|
727
727
|
176,176,176,175,178,178,178,178,
|
728
728
|
178,178,178,178,177,180,180,180,
|
729
|
-
180,180,180,180,180,179,182,
|
730
|
-
|
729
|
+
180,180,180,180,180,179,182,182,
|
730
|
+
182,182,182,182,182,182,182,182,
|
731
|
+
181,184,62,186,185,62,188,67,
|
731
732
|
67,67,67,67,67,67,67,67,
|
732
733
|
67,67,67,67,67,67,67,67,
|
733
734
|
67,67,67,67,67,67,67,67,
|
734
|
-
67,67,67,
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
194,
|
744
|
-
|
745
|
-
|
746
|
-
85,85,
|
747
|
-
|
748
|
-
88,88,88,88,88,88,88,197,
|
749
|
-
87,197,197,197,197,197,197,88,
|
735
|
+
67,67,67,67,67,67,189,67,
|
736
|
+
191,190,67,70,67,193,193,193,
|
737
|
+
193,193,193,193,193,193,193,192,
|
738
|
+
192,192,192,192,192,192,193,193,
|
739
|
+
193,193,193,193,192,192,192,192,
|
740
|
+
192,192,192,192,192,192,192,192,
|
741
|
+
192,192,192,192,192,192,192,192,
|
742
|
+
192,192,192,192,192,192,193,193,
|
743
|
+
193,193,193,193,192,195,194,194,
|
744
|
+
194,194,194,196,194,194,197,197,
|
745
|
+
197,197,197,197,197,197,197,197,
|
746
|
+
194,194,198,194,86,85,85,85,
|
747
|
+
85,85,199,85,85,199,199,199,
|
748
|
+
199,199,199,199,199,199,199,85,
|
750
749
|
88,88,88,88,88,88,88,88,
|
751
|
-
88,
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
89,
|
750
|
+
88,88,199,87,199,199,199,199,
|
751
|
+
199,199,88,88,88,88,88,88,
|
752
|
+
88,88,88,88,199,199,89,89,
|
753
|
+
89,89,89,89,89,89,89,89,
|
754
|
+
89,199,89,89,199,199,199,199,
|
755
|
+
199,199,199,199,199,199,89,89,
|
756
|
+
89,89,86,89,0
|
756
757
|
]
|
757
758
|
|
758
759
|
class << self
|
@@ -767,10 +768,10 @@ self._re_scanner_trans_targs = [
|
|
767
768
|
27,28,30,31,32,33,34,71,
|
768
769
|
36,71,37,39,0,40,41,88,
|
769
770
|
89,89,42,89,89,89,45,46,
|
770
|
-
89,89,99,99,47,50,99,
|
771
|
-
99,
|
771
|
+
89,89,99,99,47,50,99,106,
|
772
|
+
99,108,53,99,109,99,111,56,
|
772
773
|
59,57,58,99,60,61,62,63,
|
773
|
-
64,65,99,
|
774
|
+
64,65,99,113,114,67,68,114,
|
774
775
|
69,70,3,73,74,75,76,77,
|
775
776
|
71,78,71,82,83,71,84,71,
|
776
777
|
85,71,71,86,71,71,71,71,
|
@@ -780,11 +781,11 @@ self._re_scanner_trans_targs = [
|
|
780
781
|
38,90,91,92,89,93,94,95,
|
781
782
|
89,89,89,89,43,89,89,44,
|
782
783
|
89,89,89,96,97,96,96,98,
|
783
|
-
96,100,101,102,99,103,103,
|
784
|
+
96,100,101,102,99,103,103,105,
|
784
785
|
49,99,52,99,99,55,66,99,
|
785
|
-
48,99,104,99,99,99,
|
786
|
-
51,99,
|
787
|
-
|
786
|
+
48,99,104,99,99,99,99,99,
|
787
|
+
107,99,51,99,110,112,99,54,
|
788
|
+
99,99,114,115,116,117,118,114
|
788
789
|
]
|
789
790
|
|
790
791
|
class << self
|
@@ -812,11 +813,11 @@ self._re_scanner_trans_actions = [
|
|
812
813
|
0,0,40,40,66,0,40,67,
|
813
814
|
68,69,70,71,0,72,73,0,
|
814
815
|
74,75,76,77,0,78,79,0,
|
815
|
-
80,0,40,40,81,82,83,
|
816
|
-
0,
|
817
|
-
0,
|
818
|
-
|
819
|
-
98,40,40,40,40,
|
816
|
+
80,0,40,40,81,82,83,0,
|
817
|
+
0,84,0,85,86,0,0,87,
|
818
|
+
0,88,0,89,90,91,92,93,
|
819
|
+
40,94,0,95,40,0,96,0,
|
820
|
+
97,98,99,40,40,40,40,100
|
820
821
|
]
|
821
822
|
|
822
823
|
class << self
|
@@ -838,7 +839,7 @@ self._re_scanner_to_state_actions = [
|
|
838
839
|
64,64,0,0,0,0,0,0,
|
839
840
|
64,0,0,64,0,0,0,0,
|
840
841
|
0,0,0,0,0,0,0,0,
|
841
|
-
0,64,0,0,0,0
|
842
|
+
0,0,64,0,0,0,0
|
842
843
|
]
|
843
844
|
|
844
845
|
class << self
|
@@ -860,7 +861,7 @@ self._re_scanner_from_state_actions = [
|
|
860
861
|
34,34,0,0,0,0,0,0,
|
861
862
|
34,0,0,34,0,0,0,0,
|
862
863
|
0,0,0,0,0,0,0,0,
|
863
|
-
0,34,0,0,0,0
|
864
|
+
0,0,34,0,0,0,0
|
864
865
|
]
|
865
866
|
|
866
867
|
class << self
|
@@ -882,7 +883,7 @@ self._re_scanner_eof_actions = [
|
|
882
883
|
0,24,0,0,0,0,0,0,
|
883
884
|
0,0,0,24,0,0,0,0,
|
884
885
|
0,0,0,0,0,0,0,0,
|
885
|
-
0,0,0,0,0,0
|
886
|
+
0,0,0,0,0,0,0
|
886
887
|
]
|
887
888
|
|
888
889
|
class << self
|
@@ -903,8 +904,8 @@ self._re_scanner_eof_trans = [
|
|
903
904
|
116,122,123,125,127,129,134,0,
|
904
905
|
0,0,148,148,148,148,151,154,
|
905
906
|
0,159,159,0,176,176,176,178,
|
906
|
-
180,182,
|
907
|
-
|
907
|
+
180,182,184,184,184,188,188,188,
|
908
|
+
188,193,0,200,200,200,200
|
908
909
|
]
|
909
910
|
|
910
911
|
class << self
|
@@ -943,7 +944,7 @@ self.re_scanner_en_escape_sequence = 99;
|
|
943
944
|
class << self
|
944
945
|
attr_accessor :re_scanner_en_conditional_expression
|
945
946
|
end
|
946
|
-
self.re_scanner_en_conditional_expression =
|
947
|
+
self.re_scanner_en_conditional_expression = 114;
|
947
948
|
class << self
|
948
949
|
attr_accessor :re_scanner_en_main
|
949
950
|
end
|
@@ -1243,12 +1244,11 @@ p = p - 1; begin
|
|
1243
1244
|
|
1244
1245
|
end
|
1245
1246
|
end
|
1246
|
-
when
|
1247
|
+
when 90 then
|
1247
1248
|
begin
|
1248
1249
|
te = p+1
|
1249
1250
|
begin
|
1250
|
-
|
1251
|
-
emit(:backref, :number, text)
|
1251
|
+
emit(:escape, :octal, copy(data, ts-1,te))
|
1252
1252
|
begin
|
1253
1253
|
top -= 1
|
1254
1254
|
cs = stack[top]
|
@@ -1258,11 +1258,13 @@ te = p+1
|
|
1258
1258
|
|
1259
1259
|
end
|
1260
1260
|
end
|
1261
|
-
when
|
1261
|
+
when 92 then
|
1262
1262
|
begin
|
1263
1263
|
te = p+1
|
1264
|
-
begin
|
1265
|
-
|
1264
|
+
begin # special case, emits two tokens
|
1265
|
+
text = copy(data, ts-1,te)
|
1266
|
+
emit(:escape, :literal, text[0,2])
|
1267
|
+
emit(:literal, :literal, text[2])
|
1266
1268
|
begin
|
1267
1269
|
top -= 1
|
1268
1270
|
cs = stack[top]
|
@@ -1302,7 +1304,7 @@ te = p+1
|
|
1302
1304
|
|
1303
1305
|
end
|
1304
1306
|
end
|
1305
|
-
when
|
1307
|
+
when 86 then
|
1306
1308
|
begin
|
1307
1309
|
te = p+1
|
1308
1310
|
begin
|
@@ -1346,7 +1348,7 @@ te = p+1
|
|
1346
1348
|
|
1347
1349
|
end
|
1348
1350
|
end
|
1349
|
-
when
|
1351
|
+
when 98 then
|
1350
1352
|
begin
|
1351
1353
|
te = p+1
|
1352
1354
|
begin
|
@@ -1388,7 +1390,7 @@ te = p+1
|
|
1388
1390
|
|
1389
1391
|
end
|
1390
1392
|
end
|
1391
|
-
when
|
1393
|
+
when 84 then
|
1392
1394
|
begin
|
1393
1395
|
te = p+1
|
1394
1396
|
begin
|
@@ -1404,7 +1406,7 @@ te = p+1
|
|
1404
1406
|
|
1405
1407
|
end
|
1406
1408
|
end
|
1407
|
-
when
|
1409
|
+
when 85 then
|
1408
1410
|
begin
|
1409
1411
|
te = p+1
|
1410
1412
|
begin
|
@@ -1434,7 +1436,22 @@ te = p+1
|
|
1434
1436
|
|
1435
1437
|
end
|
1436
1438
|
end
|
1437
|
-
when
|
1439
|
+
when 91 then
|
1440
|
+
begin
|
1441
|
+
te = p
|
1442
|
+
p = p - 1; begin
|
1443
|
+
text = copy(data, ts-1,te)
|
1444
|
+
emit(:backref, :number, text)
|
1445
|
+
begin
|
1446
|
+
top -= 1
|
1447
|
+
cs = stack[top]
|
1448
|
+
_goto_level = _again
|
1449
|
+
next
|
1450
|
+
end
|
1451
|
+
|
1452
|
+
end
|
1453
|
+
end
|
1454
|
+
when 89 then
|
1438
1455
|
begin
|
1439
1456
|
te = p
|
1440
1457
|
p = p - 1; begin
|
@@ -1448,7 +1465,7 @@ p = p - 1; begin
|
|
1448
1465
|
|
1449
1466
|
end
|
1450
1467
|
end
|
1451
|
-
when
|
1468
|
+
when 97 then
|
1452
1469
|
begin
|
1453
1470
|
te = p
|
1454
1471
|
p = p - 1; begin
|
@@ -1462,7 +1479,7 @@ p = p - 1; begin
|
|
1462
1479
|
|
1463
1480
|
end
|
1464
1481
|
end
|
1465
|
-
when
|
1482
|
+
when 94 then
|
1466
1483
|
begin
|
1467
1484
|
te = p
|
1468
1485
|
p = p - 1; begin
|
@@ -1476,7 +1493,7 @@ p = p - 1; begin
|
|
1476
1493
|
|
1477
1494
|
end
|
1478
1495
|
end
|
1479
|
-
when
|
1496
|
+
when 96 then
|
1480
1497
|
begin
|
1481
1498
|
te = p
|
1482
1499
|
p = p - 1; begin
|
@@ -1490,7 +1507,7 @@ p = p - 1; begin
|
|
1490
1507
|
|
1491
1508
|
end
|
1492
1509
|
end
|
1493
|
-
when
|
1510
|
+
when 87 then
|
1494
1511
|
begin
|
1495
1512
|
te = p
|
1496
1513
|
p = p - 1; begin
|
@@ -1518,7 +1535,7 @@ p = p - 1; begin
|
|
1518
1535
|
|
1519
1536
|
end
|
1520
1537
|
end
|
1521
|
-
when
|
1538
|
+
when 88 then
|
1522
1539
|
begin
|
1523
1540
|
case act
|
1524
1541
|
when 17 then
|
@@ -1557,7 +1574,7 @@ te = p+1
|
|
1557
1574
|
emit(:conditional, :condition_close, ')')
|
1558
1575
|
end
|
1559
1576
|
end
|
1560
|
-
when
|
1577
|
+
when 99 then
|
1561
1578
|
begin
|
1562
1579
|
te = p+1
|
1563
1580
|
begin
|
@@ -1572,7 +1589,7 @@ te = p+1
|
|
1572
1589
|
|
1573
1590
|
end
|
1574
1591
|
end
|
1575
|
-
when
|
1592
|
+
when 100 then
|
1576
1593
|
begin
|
1577
1594
|
te = p
|
1578
1595
|
p = p - 1; begin
|
@@ -1675,7 +1692,7 @@ te = p+1
|
|
1675
1692
|
begin
|
1676
1693
|
stack[top] = cs
|
1677
1694
|
top+= 1
|
1678
|
-
cs =
|
1695
|
+
cs = 114
|
1679
1696
|
_goto_level = _again
|
1680
1697
|
next
|
1681
1698
|
end
|
@@ -1975,7 +1992,7 @@ p = p - 1; begin
|
|
1975
1992
|
next
|
1976
1993
|
end
|
1977
1994
|
end
|
1978
|
-
when
|
1995
|
+
when 42 then
|
1979
1996
|
begin begin p = ((te))-1; end
|
1980
1997
|
|
1981
1998
|
text = copy(data, ts, te)
|
@@ -1984,7 +2001,7 @@ end
|
|
1984
2001
|
end
|
1985
2002
|
emit_options(text)
|
1986
2003
|
end
|
1987
|
-
when
|
2004
|
+
when 43 then
|
1988
2005
|
begin begin p = ((te))-1; end
|
1989
2006
|
|
1990
2007
|
case text = copy(data, ts, te)
|
@@ -1994,7 +2011,7 @@ end
|
|
1994
2011
|
when '(?<!'; emit(:assertion, :nlookbehind, text)
|
1995
2012
|
end
|
1996
2013
|
end
|
1997
|
-
when
|
2014
|
+
when 57 then
|
1998
2015
|
begin begin p = ((te))-1; end
|
1999
2016
|
|
2000
2017
|
append_literal(data, ts, te)
|
@@ -2041,7 +2058,7 @@ p = p - 1; begin
|
|
2041
2058
|
|
2042
2059
|
end
|
2043
2060
|
end
|
2044
|
-
when
|
2061
|
+
when 93 then
|
2045
2062
|
begin
|
2046
2063
|
|
2047
2064
|
text = copy(data, ts ? ts-1 : 0,-1)
|
@@ -2060,7 +2077,7 @@ p = p - 1; begin
|
|
2060
2077
|
|
2061
2078
|
end
|
2062
2079
|
end
|
2063
|
-
when
|
2080
|
+
when 95 then
|
2064
2081
|
begin
|
2065
2082
|
|
2066
2083
|
text = copy(data, ts ? ts-1 : 0,-1)
|
@@ -2279,19 +2296,19 @@ act = 18; end
|
|
2279
2296
|
te = p+1
|
2280
2297
|
end
|
2281
2298
|
begin
|
2282
|
-
act =
|
2299
|
+
act = 42; end
|
2283
2300
|
when 7 then
|
2284
2301
|
begin
|
2285
2302
|
te = p+1
|
2286
2303
|
end
|
2287
2304
|
begin
|
2288
|
-
act =
|
2305
|
+
act = 43; end
|
2289
2306
|
when 2 then
|
2290
2307
|
begin
|
2291
2308
|
te = p+1
|
2292
2309
|
end
|
2293
2310
|
begin
|
2294
|
-
act =
|
2311
|
+
act = 57; end
|
2295
2312
|
end
|
2296
2313
|
end
|
2297
2314
|
end
|
data/regexp_parser.gemspec
CHANGED
@@ -16,17 +16,15 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.metadata['source_code_uri'] = spec.homepage
|
17
17
|
spec.metadata['wiki_uri'] = "#{spec.homepage}/wiki"
|
18
18
|
|
19
|
-
spec.authors = ['Ammar Ali']
|
20
|
-
spec.email = ['ammarabuali@gmail.com']
|
19
|
+
spec.authors = ['Ammar Ali', 'Janosch Müller']
|
20
|
+
spec.email = ['ammarabuali@gmail.com', 'janosch84@gmail.com']
|
21
21
|
|
22
22
|
spec.license = 'MIT'
|
23
23
|
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
26
|
spec.files = Dir.glob('lib/**/*.{csv,rb,rl}') +
|
27
|
-
%w[Gemfile Rakefile LICENSE
|
28
|
-
|
29
|
-
spec.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
27
|
+
%w[Gemfile Rakefile LICENSE regexp_parser.gemspec]
|
30
28
|
|
31
29
|
spec.platform = Gem::Platform::RUBY
|
32
30
|
|
metadata
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regexp_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ammar Ali
|
8
|
+
- Janosch Müller
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2023-
|
12
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
14
|
description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
|
14
15
|
email:
|
15
16
|
- ammarabuali@gmail.com
|
17
|
+
- janosch84@gmail.com
|
16
18
|
executables: []
|
17
19
|
extensions: []
|
18
20
|
extra_rdoc_files: []
|
19
21
|
files:
|
20
|
-
- CHANGELOG.md
|
21
22
|
- Gemfile
|
22
23
|
- LICENSE
|
23
|
-
- README.md
|
24
24
|
- Rakefile
|
25
25
|
- lib/regexp_parser.rb
|
26
26
|
- lib/regexp_parser/error.rb
|
@@ -115,9 +115,7 @@ metadata:
|
|
115
115
|
source_code_uri: https://github.com/ammar/regexp_parser
|
116
116
|
wiki_uri: https://github.com/ammar/regexp_parser/wiki
|
117
117
|
post_install_message:
|
118
|
-
rdoc_options:
|
119
|
-
- "--inline-source"
|
120
|
-
- "--charset=UTF-8"
|
118
|
+
rdoc_options: []
|
121
119
|
require_paths:
|
122
120
|
- lib
|
123
121
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -131,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
129
|
- !ruby/object:Gem::Version
|
132
130
|
version: '0'
|
133
131
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.5.0.dev
|
135
133
|
signing_key:
|
136
134
|
specification_version: 4
|
137
135
|
summary: Scanner, lexer, parser for ruby's regular expressions
|