ruby_parser 3.19.1 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +24 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +2 -1
- data/Rakefile +14 -8
- data/lib/ruby20_parser.rb +1 -1
- data/lib/ruby21_parser.rb +1 -1
- data/lib/ruby22_parser.rb +1 -1
- data/lib/ruby23_parser.rb +1 -1
- data/lib/ruby24_parser.rb +1 -1
- data/lib/ruby25_parser.rb +1 -1
- data/lib/ruby26_parser.rb +1 -1
- data/lib/ruby27_parser.rb +26 -10
- data/lib/ruby27_parser.y +13 -1
- data/lib/ruby30_parser.rb +26 -10
- data/lib/ruby30_parser.y +13 -1
- data/lib/ruby31_parser.rb +26 -10
- data/lib/ruby31_parser.y +13 -1
- data/lib/ruby32_parser.rb +13638 -0
- data/lib/ruby32_parser.y +3493 -0
- data/lib/ruby3_parser.yy +15 -1
- data/lib/ruby_lexer.rb +11 -4
- data/lib/ruby_parser.rb +2 -0
- data/lib/ruby_parser.yy +13 -1
- data/lib/ruby_parser_extras.rb +12 -5
- data/test/test_ruby_lexer.rb +13 -0
- data/test/test_ruby_parser.rb +65 -25
- data.tar.gz.sig +1 -1
- metadata +16 -14
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe94228dc0622091501dfb99f5fe522983b9ac8daa618eaf50e8925ce818aae
|
4
|
+
data.tar.gz: f40651573fa4769fdb77e2bdddc1429aa7b5a02c78753bf762311fac18d37dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52eeaa22c91a134e7d61fd11d8ecf366b6634f80940450802460f57dcd2e1483cfdfabc455007b11c3bf468974d24c78641b0c0cd677d366070a11da7da63acc
|
7
|
+
data.tar.gz: f517db6a7e6bb364638a6aa3c81b6304d6b1b90b6e92702675b4a601badb117efdf5254ff753675274d6ed95b9db097f1ef7d82c601b7b664ae35ff76e4d6415
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
=== 3.20.0 / 2023-03-04
|
2
|
+
|
3
|
+
* 1 major enhancement:
|
4
|
+
|
5
|
+
* Added tentative 3.2 support.
|
6
|
+
|
7
|
+
* 1 minor enhancement:
|
8
|
+
|
9
|
+
* Change minimum ruby version to 2.6. (want higher)
|
10
|
+
|
11
|
+
* 1 bug fix:
|
12
|
+
|
13
|
+
* Fix up compare tasks for ruby 3.2 differences.
|
14
|
+
|
15
|
+
=== 3.19.2 / 2022-12-03
|
16
|
+
|
17
|
+
* 5 bug fixes:
|
18
|
+
|
19
|
+
* Fixed bug parsing array patterns using %w, %i, etc.
|
20
|
+
* Fixed dedenting when heredoc has only empty line and interpolation. (mvz)
|
21
|
+
* Fixed dsym unescaping. (mvz)
|
22
|
+
* Fixed vars in pattern matching that should be lasgn, not lvar.
|
23
|
+
* find_pat mid-patterns are now splatted inline, not wrapped in an array_pat.
|
24
|
+
|
1
25
|
=== 3.19.1 / 2022-04-05
|
2
26
|
|
3
27
|
* 2 bug fixes:
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -68,8 +68,9 @@ To add a new version:
|
|
68
68
|
* New parser should be generated from lib/ruby[3]_parser.yy.
|
69
69
|
* Extend lib/ruby[3]_parser.yy with new class name.
|
70
70
|
* Add new version number to V2/V3 in Rakefile for rule creation.
|
71
|
-
* Add new
|
71
|
+
* Add new `ruby_parse "x.y.z"` line to Rakefile for rake compare (line ~300).
|
72
72
|
* Require generated parser in lib/ruby_parser.rb.
|
73
|
+
* Add new V## = ::Ruby##Parser; end to ruby_parser.rb (bottom of file).
|
73
74
|
* Add empty TestRubyParserShared##Plus module and TestRubyParserV## to test/test_ruby_parser.rb.
|
74
75
|
* Extend Manifest.txt with generated file names.
|
75
76
|
* Add new version number to sexp_processor's pt_testcase.rb in all_versions
|
data/Rakefile
CHANGED
@@ -12,9 +12,10 @@ Hoe.add_include_dirs "lib"
|
|
12
12
|
Hoe.add_include_dirs "../../sexp_processor/dev/lib"
|
13
13
|
Hoe.add_include_dirs "../../minitest/dev/lib"
|
14
14
|
Hoe.add_include_dirs "../../oedipus_lex/dev/lib"
|
15
|
+
Hoe.add_include_dirs "../../ruby2ruby/dev/lib"
|
15
16
|
|
16
17
|
V2 = %w[20 21 22 23 24 25 26 27]
|
17
|
-
V3 = %w[30 31]
|
18
|
+
V3 = %w[30 31 32]
|
18
19
|
|
19
20
|
VERS = V2 + V3
|
20
21
|
|
@@ -37,7 +38,7 @@ Hoe.spec "ruby_parser" do
|
|
37
38
|
|
38
39
|
dependency "racc", "~> 1.5", :developer
|
39
40
|
|
40
|
-
require_ruby_version [">= 2.
|
41
|
+
require_ruby_version [">= 2.6", "< 4"]
|
41
42
|
|
42
43
|
if plugin? :perforce then # generated files
|
43
44
|
VERS.each do |n|
|
@@ -185,6 +186,9 @@ def ruby_parse version
|
|
185
186
|
file c_parse_y => c_tarball do
|
186
187
|
in_compare do
|
187
188
|
extract_glob = case
|
189
|
+
# defs/id.def
|
190
|
+
when version > "3.2" then
|
191
|
+
"{id.h,parse.y,tool/{id2token.rb,lib/vpath.rb},defs/id.def}"
|
188
192
|
when version > "2.7" then
|
189
193
|
"{id.h,parse.y,tool/{id2token.rb,lib/vpath.rb}}"
|
190
194
|
else
|
@@ -194,7 +198,8 @@ def ruby_parse version
|
|
194
198
|
|
195
199
|
Dir.chdir ruby_dir do
|
196
200
|
if File.exist? "tool/id2token.rb" then
|
197
|
-
|
201
|
+
args = version < "3.2" ? "--path-separator=.:./ id.h" : ""
|
202
|
+
sh "ruby tool/id2token.rb #{args} parse.y | expand > ../#{parse_y}"
|
198
203
|
else
|
199
204
|
sh "expand parse.y > ../#{parse_y}"
|
200
205
|
end
|
@@ -249,7 +254,7 @@ def ruby_parse version
|
|
249
254
|
end
|
250
255
|
|
251
256
|
task :realclean do
|
252
|
-
rm_f Dir[c_parse_y,
|
257
|
+
rm_f Dir[c_parse_y, c_tarball]
|
253
258
|
end
|
254
259
|
end
|
255
260
|
|
@@ -291,10 +296,11 @@ ruby_parse "2.2.10"
|
|
291
296
|
ruby_parse "2.3.8"
|
292
297
|
ruby_parse "2.4.10"
|
293
298
|
ruby_parse "2.5.9"
|
294
|
-
ruby_parse "2.6.
|
295
|
-
ruby_parse "2.7.
|
296
|
-
ruby_parse "3.0.
|
297
|
-
ruby_parse "3.1.
|
299
|
+
ruby_parse "2.6.10"
|
300
|
+
ruby_parse "2.7.7"
|
301
|
+
ruby_parse "3.0.5"
|
302
|
+
ruby_parse "3.1.3"
|
303
|
+
ruby_parse "3.2.1"
|
298
304
|
|
299
305
|
task :debug => :isolate do
|
300
306
|
ENV["V"] ||= VERS.last
|
data/lib/ruby20_parser.rb
CHANGED
data/lib/ruby21_parser.rb
CHANGED
data/lib/ruby22_parser.rb
CHANGED
data/lib/ruby23_parser.rb
CHANGED
data/lib/ruby24_parser.rb
CHANGED
data/lib/ruby25_parser.rb
CHANGED
data/lib/ruby26_parser.rb
CHANGED
data/lib/ruby27_parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.6.
|
3
|
+
# This file is automatically generated by Racc 1.6.2
|
4
4
|
# from Racc grammar file "".
|
5
5
|
#
|
6
6
|
|
@@ -7722,10 +7722,10 @@ racc_reduce_table = [
|
|
7722
7722
|
1, 364, :_reduce_none,
|
7723
7723
|
1, 364, :_reduce_none,
|
7724
7724
|
1, 364, :_reduce_none,
|
7725
|
-
1, 364, :
|
7726
|
-
1, 364, :
|
7727
|
-
1, 364, :
|
7728
|
-
1, 364, :
|
7725
|
+
1, 364, :_reduce_548,
|
7726
|
+
1, 364, :_reduce_549,
|
7727
|
+
1, 364, :_reduce_550,
|
7728
|
+
1, 364, :_reduce_551,
|
7729
7729
|
1, 364, :_reduce_552,
|
7730
7730
|
1, 364, :_reduce_none,
|
7731
7731
|
1, 344, :_reduce_554,
|
@@ -11813,13 +11813,29 @@ end
|
|
11813
11813
|
|
11814
11814
|
# reduce 547 omitted
|
11815
11815
|
|
11816
|
-
|
11816
|
+
def _reduce_548(val, _values, result)
|
11817
|
+
result = ary_to_pat val[0]
|
11818
|
+
|
11819
|
+
result
|
11820
|
+
end
|
11821
|
+
|
11822
|
+
def _reduce_549(val, _values, result)
|
11823
|
+
result = ary_to_pat val[0]
|
11817
11824
|
|
11818
|
-
|
11825
|
+
result
|
11826
|
+
end
|
11827
|
+
|
11828
|
+
def _reduce_550(val, _values, result)
|
11829
|
+
result = ary_to_pat val[0]
|
11830
|
+
|
11831
|
+
result
|
11832
|
+
end
|
11819
11833
|
|
11820
|
-
|
11834
|
+
def _reduce_551(val, _values, result)
|
11835
|
+
result = ary_to_pat val[0]
|
11821
11836
|
|
11822
|
-
|
11837
|
+
result
|
11838
|
+
end
|
11823
11839
|
|
11824
11840
|
def _reduce_552(val, _values, result)
|
11825
11841
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -11835,7 +11851,7 @@ end
|
|
11835
11851
|
def _reduce_554(val, _values, result)
|
11836
11852
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
11837
11853
|
# TODO: assignable(p, $1, 0, &@$);
|
11838
|
-
result = wrap :
|
11854
|
+
result = wrap :lasgn, val[0]
|
11839
11855
|
|
11840
11856
|
result
|
11841
11857
|
end
|
data/lib/ruby27_parser.y
CHANGED
@@ -2453,9 +2453,21 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2453
2453
|
| xstring
|
2454
2454
|
| regexp
|
2455
2455
|
| words
|
2456
|
+
{
|
2457
|
+
result = ary_to_pat val[0]
|
2458
|
+
}
|
2456
2459
|
| qwords
|
2460
|
+
{
|
2461
|
+
result = ary_to_pat val[0]
|
2462
|
+
}
|
2457
2463
|
| symbols
|
2464
|
+
{
|
2465
|
+
result = ary_to_pat val[0]
|
2466
|
+
}
|
2458
2467
|
| qsymbols
|
2468
|
+
{
|
2469
|
+
result = ary_to_pat val[0]
|
2470
|
+
}
|
2459
2471
|
| keyword_variable
|
2460
2472
|
{
|
2461
2473
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -2469,7 +2481,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2469
2481
|
{
|
2470
2482
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
2471
2483
|
# TODO: assignable(p, $1, 0, &@$);
|
2472
|
-
result = wrap :
|
2484
|
+
result = wrap :lasgn, val[0]
|
2473
2485
|
}
|
2474
2486
|
|
2475
2487
|
p_var_ref: tCARET tIDENTIFIER
|
data/lib/ruby30_parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.6.
|
3
|
+
# This file is automatically generated by Racc 1.6.2
|
4
4
|
# from Racc grammar file "".
|
5
5
|
#
|
6
6
|
|
@@ -7841,10 +7841,10 @@ racc_reduce_table = [
|
|
7841
7841
|
1, 371, :_reduce_none,
|
7842
7842
|
1, 371, :_reduce_none,
|
7843
7843
|
1, 371, :_reduce_none,
|
7844
|
-
1, 371, :
|
7845
|
-
1, 371, :
|
7846
|
-
1, 371, :
|
7847
|
-
1, 371, :
|
7844
|
+
1, 371, :_reduce_561,
|
7845
|
+
1, 371, :_reduce_562,
|
7846
|
+
1, 371, :_reduce_563,
|
7847
|
+
1, 371, :_reduce_564,
|
7848
7848
|
1, 371, :_reduce_565,
|
7849
7849
|
1, 371, :_reduce_none,
|
7850
7850
|
1, 350, :_reduce_567,
|
@@ -12038,13 +12038,29 @@ end
|
|
12038
12038
|
|
12039
12039
|
# reduce 560 omitted
|
12040
12040
|
|
12041
|
-
|
12041
|
+
def _reduce_561(val, _values, result)
|
12042
|
+
result = ary_to_pat val[0]
|
12043
|
+
|
12044
|
+
result
|
12045
|
+
end
|
12046
|
+
|
12047
|
+
def _reduce_562(val, _values, result)
|
12048
|
+
result = ary_to_pat val[0]
|
12042
12049
|
|
12043
|
-
|
12050
|
+
result
|
12051
|
+
end
|
12052
|
+
|
12053
|
+
def _reduce_563(val, _values, result)
|
12054
|
+
result = ary_to_pat val[0]
|
12055
|
+
|
12056
|
+
result
|
12057
|
+
end
|
12044
12058
|
|
12045
|
-
|
12059
|
+
def _reduce_564(val, _values, result)
|
12060
|
+
result = ary_to_pat val[0]
|
12046
12061
|
|
12047
|
-
|
12062
|
+
result
|
12063
|
+
end
|
12048
12064
|
|
12049
12065
|
def _reduce_565(val, _values, result)
|
12050
12066
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -12060,7 +12076,7 @@ end
|
|
12060
12076
|
def _reduce_567(val, _values, result)
|
12061
12077
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
12062
12078
|
# TODO: assignable(p, $1, 0, &@$);
|
12063
|
-
result = wrap :
|
12079
|
+
result = wrap :lasgn, val[0]
|
12064
12080
|
|
12065
12081
|
result
|
12066
12082
|
end
|
data/lib/ruby30_parser.y
CHANGED
@@ -2534,9 +2534,21 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2534
2534
|
| xstring
|
2535
2535
|
| regexp
|
2536
2536
|
| words
|
2537
|
+
{
|
2538
|
+
result = ary_to_pat val[0]
|
2539
|
+
}
|
2537
2540
|
| qwords
|
2541
|
+
{
|
2542
|
+
result = ary_to_pat val[0]
|
2543
|
+
}
|
2538
2544
|
| symbols
|
2545
|
+
{
|
2546
|
+
result = ary_to_pat val[0]
|
2547
|
+
}
|
2539
2548
|
| qsymbols
|
2549
|
+
{
|
2550
|
+
result = ary_to_pat val[0]
|
2551
|
+
}
|
2540
2552
|
| keyword_variable
|
2541
2553
|
{
|
2542
2554
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -2550,7 +2562,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2550
2562
|
{
|
2551
2563
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
2552
2564
|
# TODO: assignable(p, $1, 0, &@$);
|
2553
|
-
result = wrap :
|
2565
|
+
result = wrap :lasgn, val[0]
|
2554
2566
|
}
|
2555
2567
|
|
2556
2568
|
p_var_ref: tCARET tIDENTIFIER
|
data/lib/ruby31_parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.6.
|
3
|
+
# This file is automatically generated by Racc 1.6.2
|
4
4
|
# from Racc grammar file "".
|
5
5
|
#
|
6
6
|
|
@@ -8153,10 +8153,10 @@ racc_reduce_table = [
|
|
8153
8153
|
1, 373, :_reduce_none,
|
8154
8154
|
1, 373, :_reduce_none,
|
8155
8155
|
1, 373, :_reduce_none,
|
8156
|
-
1, 373, :
|
8157
|
-
1, 373, :
|
8158
|
-
1, 373, :
|
8159
|
-
1, 373, :
|
8156
|
+
1, 373, :_reduce_569,
|
8157
|
+
1, 373, :_reduce_570,
|
8158
|
+
1, 373, :_reduce_571,
|
8159
|
+
1, 373, :_reduce_572,
|
8160
8160
|
1, 373, :_reduce_573,
|
8161
8161
|
1, 373, :_reduce_none,
|
8162
8162
|
1, 351, :_reduce_575,
|
@@ -12399,13 +12399,29 @@ end
|
|
12399
12399
|
|
12400
12400
|
# reduce 568 omitted
|
12401
12401
|
|
12402
|
-
|
12402
|
+
def _reduce_569(val, _values, result)
|
12403
|
+
result = ary_to_pat val[0]
|
12404
|
+
|
12405
|
+
result
|
12406
|
+
end
|
12407
|
+
|
12408
|
+
def _reduce_570(val, _values, result)
|
12409
|
+
result = ary_to_pat val[0]
|
12403
12410
|
|
12404
|
-
|
12411
|
+
result
|
12412
|
+
end
|
12413
|
+
|
12414
|
+
def _reduce_571(val, _values, result)
|
12415
|
+
result = ary_to_pat val[0]
|
12416
|
+
|
12417
|
+
result
|
12418
|
+
end
|
12405
12419
|
|
12406
|
-
|
12420
|
+
def _reduce_572(val, _values, result)
|
12421
|
+
result = ary_to_pat val[0]
|
12407
12422
|
|
12408
|
-
|
12423
|
+
result
|
12424
|
+
end
|
12409
12425
|
|
12410
12426
|
def _reduce_573(val, _values, result)
|
12411
12427
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -12421,7 +12437,7 @@ end
|
|
12421
12437
|
def _reduce_575(val, _values, result)
|
12422
12438
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
12423
12439
|
# TODO: assignable(p, $1, 0, &@$);
|
12424
|
-
result = wrap :
|
12440
|
+
result = wrap :lasgn, val[0]
|
12425
12441
|
|
12426
12442
|
result
|
12427
12443
|
end
|
data/lib/ruby31_parser.y
CHANGED
@@ -2562,9 +2562,21 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2562
2562
|
| xstring
|
2563
2563
|
| regexp
|
2564
2564
|
| words
|
2565
|
+
{
|
2566
|
+
result = ary_to_pat val[0]
|
2567
|
+
}
|
2565
2568
|
| qwords
|
2569
|
+
{
|
2570
|
+
result = ary_to_pat val[0]
|
2571
|
+
}
|
2566
2572
|
| symbols
|
2573
|
+
{
|
2574
|
+
result = ary_to_pat val[0]
|
2575
|
+
}
|
2567
2576
|
| qsymbols
|
2577
|
+
{
|
2578
|
+
result = ary_to_pat val[0]
|
2579
|
+
}
|
2568
2580
|
| keyword_variable
|
2569
2581
|
{
|
2570
2582
|
# TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
|
@@ -2578,7 +2590,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2578
2590
|
{
|
2579
2591
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
2580
2592
|
# TODO: assignable(p, $1, 0, &@$);
|
2581
|
-
result = wrap :
|
2593
|
+
result = wrap :lasgn, val[0]
|
2582
2594
|
}
|
2583
2595
|
|
2584
2596
|
p_var_ref: tCARET tIDENTIFIER
|