ruby_parser 3.21.0 → 3.22.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 +35 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +12 -0
- data/Rakefile +28 -19
- data/bin/ruby_parse +0 -8
- data/compare/normalize.rb +17 -3
- data/gauntlet.md +35 -5
- data/lib/ruby_lexer.rb +0 -2
- data/lib/ruby_parser.rb +3 -1
- data/lib/ruby_parser2.yy +12 -12
- data/lib/ruby_parser20.rb +11 -11
- data/lib/ruby_parser21.rb +11 -11
- data/lib/ruby_parser22.rb +11 -11
- data/lib/ruby_parser23.rb +11 -11
- data/lib/ruby_parser24.rb +11 -11
- data/lib/ruby_parser25.rb +11 -11
- data/lib/ruby_parser26.rb +11 -11
- data/lib/ruby_parser27.rb +13 -13
- data/lib/ruby_parser3.yy +207 -46
- data/lib/ruby_parser30.rb +3329 -3317
- data/lib/ruby_parser31.rb +3762 -3774
- data/lib/ruby_parser32.rb +6240 -6252
- data/lib/ruby_parser33.rb +7918 -7842
- data/lib/ruby_parser34.rb +13653 -0
- data/lib/ruby_parser_extras.rb +78 -46
- data/test/test_ruby_lexer.rb +2 -2
- data/test/test_ruby_parser.rb +51 -94
- data.tar.gz.sig +3 -1
- metadata +15 -20
- 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: 85e0b8be9bde480e346aebefe0528ae1e9ae989099322a104f11a15bafeb4893
|
|
4
|
+
data.tar.gz: aba5c7b2e8f1c5abee465a4310c72608a342e84798b747621e02dfc5d5786348
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5e64767ac3e7b57d4a44019ba5714e6d4c684a1e615af18fd5bb529a73a11f7910ca395479d9dd55f367e21538516a7d7d67d49d57eebdd1c9e9f6c0e536035
|
|
7
|
+
data.tar.gz: cb517bb8a96e31abdef445eefd32c7b18327a8d27fd7e60a28d6549cf50782e22aede1f7052b152a00befd25b1c845e4328758a48891785efaeb47396aa85c3f
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
=== 3.22.0 / 2025-12-20
|
|
2
|
+
|
|
3
|
+
* 1 major enhancement:
|
|
4
|
+
|
|
5
|
+
* Announced the EOL of ruby_parser! YAY!
|
|
6
|
+
|
|
7
|
+
* 6 minor enhancements:
|
|
8
|
+
|
|
9
|
+
* 3.3: working down the grammar structural differences.
|
|
10
|
+
* Added tentative 3.4 support.
|
|
11
|
+
* Renamed assignable to old_assignable and added newer cleaner assignable
|
|
12
|
+
* Restructured comparison rake tasks and normalization to deal with lrama changes.
|
|
13
|
+
* Updated compare versions and added 3.4.
|
|
14
|
+
* Updated grammars to fit most closely to ruby 3.2. Working it down the line.
|
|
15
|
+
|
|
16
|
+
* 11 bug fixes:
|
|
17
|
+
|
|
18
|
+
* Always raise RubyParser::SyntaxError (wrap and raise).
|
|
19
|
+
* Bumped ruby version to 3.2+.
|
|
20
|
+
* Cleaned up user_variable productions to always return sexps.
|
|
21
|
+
* Corrections and enhancements for gauntlet.md instructions.
|
|
22
|
+
* Fixed rake compare's clean subtask to nuke the unpacked ruby dirs entirely.
|
|
23
|
+
* Fixed superclass of V34.
|
|
24
|
+
* Fixed up a couple errors created by using STRICT_SEXP=2. 3 will be neigh impossible.
|
|
25
|
+
* I am nothing if not stubborn: fixed errors caused by STRICT_SEXP=3.
|
|
26
|
+
* Minor fixes for 3.2+ grammars on "defined?" expressions.
|
|
27
|
+
* Removed a lot of ancient compatibility checks and patches. (eg encodings)
|
|
28
|
+
* This in turn cleaned up var_ref and a bunch of other productions.
|
|
29
|
+
|
|
30
|
+
=== 3.21.1 / 2024-07-09
|
|
31
|
+
|
|
32
|
+
* 1 bug fix:
|
|
33
|
+
|
|
34
|
+
* Fix errors created when string literals are frozen.
|
|
35
|
+
|
|
1
36
|
=== 3.21.0 / 2024-01-15
|
|
2
37
|
|
|
3
38
|
* 18 minor enhancements:
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
|
@@ -4,6 +4,18 @@ home :: https://github.com/seattlerb/ruby_parser
|
|
|
4
4
|
bugs :: https://github.com/seattlerb/ruby_parser/issues
|
|
5
5
|
rdoc :: http://docs.seattlerb.org/ruby_parser
|
|
6
6
|
|
|
7
|
+
== NOTICE:
|
|
8
|
+
|
|
9
|
+
With the advent of prism, and it's ruby_parser compatibility mode,
|
|
10
|
+
this project is EOL. I've switched all my projects that use
|
|
11
|
+
ruby_parser over to prism with only a minimum of fixes sent upstream.
|
|
12
|
+
Use prism ~> 1.7 for best results.
|
|
13
|
+
|
|
14
|
+
I'm doing one more release to get my standing changes out into the
|
|
15
|
+
world and might follow up with another if anything adverse is
|
|
16
|
+
reported... but other than that, I'm very happy to put this out to
|
|
17
|
+
pasture.
|
|
18
|
+
|
|
7
19
|
== DESCRIPTION:
|
|
8
20
|
|
|
9
21
|
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing
|
data/Rakefile
CHANGED
|
@@ -9,12 +9,11 @@ Hoe.plugin :rdoc
|
|
|
9
9
|
|
|
10
10
|
Hoe.add_include_dirs "lib"
|
|
11
11
|
Hoe.add_include_dirs "../../sexp_processor/dev/lib"
|
|
12
|
-
Hoe.add_include_dirs "../../minitest/dev/lib"
|
|
13
12
|
Hoe.add_include_dirs "../../oedipus_lex/dev/lib"
|
|
14
13
|
Hoe.add_include_dirs "../../ruby2ruby/dev/lib"
|
|
15
14
|
|
|
16
15
|
V2 = %w[20 21 22 23 24 25 26 27]
|
|
17
|
-
V3 = %w[30 31 32 33]
|
|
16
|
+
V3 = %w[30 31 32 33 34]
|
|
18
17
|
|
|
19
18
|
VERS = V2 + V3
|
|
20
19
|
|
|
@@ -33,7 +32,7 @@ Hoe.spec "ruby_parser" do
|
|
|
33
32
|
dependency "rake", [">= 10", "< 15"], :developer
|
|
34
33
|
dependency "oedipus_lex", "~> 2.6", :developer
|
|
35
34
|
|
|
36
|
-
require_ruby_version
|
|
35
|
+
require_ruby_version ">= 3.2"
|
|
37
36
|
|
|
38
37
|
if plugin? :perforce then # generated files
|
|
39
38
|
VERS.each do |n|
|
|
@@ -143,7 +142,16 @@ task :parser => :isolate
|
|
|
143
142
|
|
|
144
143
|
multitask :compare_build
|
|
145
144
|
task :compare_build => :generate
|
|
146
|
-
task :compare => :compare_build
|
|
145
|
+
task :compare => :compare_build do
|
|
146
|
+
if ENV["V"] then
|
|
147
|
+
versions = task(:compare_build).prerequisites
|
|
148
|
+
latest_diff = task(versions.last).prerequisites.last
|
|
149
|
+
file = File.read latest_diff
|
|
150
|
+
|
|
151
|
+
puts
|
|
152
|
+
puts file
|
|
153
|
+
end
|
|
154
|
+
end
|
|
147
155
|
|
|
148
156
|
def ruby_parse version
|
|
149
157
|
v = version[/^\d+\.\d+/].delete "."
|
|
@@ -164,7 +172,7 @@ def ruby_parse version
|
|
|
164
172
|
desc "fetch all tarballs"
|
|
165
173
|
task :fetch => tarball
|
|
166
174
|
|
|
167
|
-
file
|
|
175
|
+
file ruby_dir => tarball do
|
|
168
176
|
extract_glob = case
|
|
169
177
|
when version > "3.3" then
|
|
170
178
|
"{id.h,parse.y,tool/{id2token.rb,lrama},defs/id.def}"
|
|
@@ -176,15 +184,20 @@ def ruby_parse version
|
|
|
176
184
|
"{id.h,parse.y,tool/{id2token.rb,vpath.rb}}"
|
|
177
185
|
end
|
|
178
186
|
system "tar xf #{tarball} -C compare #{File.basename ruby_dir}/#{extract_glob}"
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
file parse_y => ruby_dir do
|
|
190
|
+
# env -u RUBYOPT rake compare/parse33.y
|
|
191
|
+
warn "Warning: RUBYOPT is set! Use 'env -u RUBYOPT rake'" if ENV["RUBYOPT"]
|
|
179
192
|
|
|
180
193
|
# Debugging a new parse build system:
|
|
181
194
|
#
|
|
182
195
|
# Unpack the ruby tarball in question, configure, and run the following:
|
|
183
196
|
#
|
|
184
|
-
# %
|
|
197
|
+
# % [ -e Makefile ] || ./configure ; make -n -W parse.y parse.c
|
|
185
198
|
# ...
|
|
186
199
|
# echo generating parse.c
|
|
187
|
-
#
|
|
200
|
+
# ruby --disable=gems ./tool/id2token.rb parse.y | \
|
|
188
201
|
# ruby ./tool/lrama/exe/lrama -oparse.c -Hparse.h - parse.y
|
|
189
202
|
#
|
|
190
203
|
# Then integrate these commands into the mess below:
|
|
@@ -197,12 +210,6 @@ def ruby_parse version
|
|
|
197
210
|
end
|
|
198
211
|
|
|
199
212
|
sh cmd
|
|
200
|
-
|
|
201
|
-
if File.exist? "#{d}/tool/lrama" then # UGH: this is dumb
|
|
202
|
-
rm_rf "compare/lrama"
|
|
203
|
-
sh "mv #{d}/tool/lrama compare"
|
|
204
|
-
end
|
|
205
|
-
sh "rm -rf #{d}"
|
|
206
213
|
end
|
|
207
214
|
|
|
208
215
|
bison = Dir["/opt/homebrew/opt/bison/bin/bison",
|
|
@@ -211,8 +218,9 @@ def ruby_parse version
|
|
|
211
218
|
].first
|
|
212
219
|
|
|
213
220
|
file mri_txt => [parse_y, normalize] do
|
|
221
|
+
d = ruby_dir
|
|
214
222
|
if version > "3.3" then
|
|
215
|
-
sh "
|
|
223
|
+
sh "./#{d}/tool/lrama/exe/lrama -r states --report-file=compare/parse#{v}.output -ocompare/parse#{v}.tab.c #{parse_y}"
|
|
216
224
|
else
|
|
217
225
|
sh "#{bison} -r all #{parse_y}"
|
|
218
226
|
mv Dir["parse#{v}.*"], "compare"
|
|
@@ -247,7 +255,7 @@ def ruby_parse version
|
|
|
247
255
|
end
|
|
248
256
|
|
|
249
257
|
task :clean do
|
|
250
|
-
|
|
258
|
+
rm_rf Dir[mri_txt, rp_txt, ruby_dir]
|
|
251
259
|
end
|
|
252
260
|
|
|
253
261
|
task :realclean do
|
|
@@ -295,10 +303,11 @@ ruby_parse "2.4.10"
|
|
|
295
303
|
ruby_parse "2.5.9"
|
|
296
304
|
ruby_parse "2.6.10"
|
|
297
305
|
ruby_parse "2.7.8"
|
|
298
|
-
ruby_parse "3.0.
|
|
299
|
-
ruby_parse "3.1.
|
|
300
|
-
ruby_parse "3.2.
|
|
301
|
-
ruby_parse "3.3.
|
|
306
|
+
ruby_parse "3.0.7"
|
|
307
|
+
ruby_parse "3.1.7"
|
|
308
|
+
ruby_parse "3.2.9"
|
|
309
|
+
ruby_parse "3.3.9"
|
|
310
|
+
ruby_parse "3.4.5"
|
|
302
311
|
|
|
303
312
|
task :debug => :isolate do
|
|
304
313
|
ENV["V"] ||= VERS.last
|
data/bin/ruby_parse
CHANGED
data/compare/normalize.rb
CHANGED
|
@@ -91,6 +91,7 @@ def munge s
|
|
|
91
91
|
|
|
92
92
|
"keyword_BEGIN", "klBEGIN",
|
|
93
93
|
"keyword_END", "klEND",
|
|
94
|
+
"k_END", "klEND",
|
|
94
95
|
/keyword_(\w+)/, proc { "k#{$1.upcase}" },
|
|
95
96
|
/\bk_([a-z_]+)/, proc { "k#{$1.upcase}" },
|
|
96
97
|
/modifier_(\w+)/, proc { "k#{$1.upcase}_MOD" },
|
|
@@ -153,13 +154,22 @@ def munge s
|
|
|
153
154
|
|
|
154
155
|
'"do (for condition)"', "kDO_COND",
|
|
155
156
|
'"do (for lambda)"', "kDO_LAMBDA",
|
|
156
|
-
'
|
|
157
|
+
%("'do' for block"), "kDO_BLOCK", # 3.4
|
|
158
|
+
%("'do' for lambda"), "kDO_LAMBDA", # 3.4
|
|
159
|
+
%("'do' for condition"),"kDO_COND", # 3.4
|
|
160
|
+
%q("#{"), "tSTRING_DBEG", # 3.4
|
|
161
|
+
'"do (for block)"', "kDO_BLOCK", # 3.4
|
|
157
162
|
|
|
163
|
+
/\"'(\w+)' \(?modifier\)?\"/, proc { |x| "k#{$1.upcase}_MOD" }, # 3.4
|
|
158
164
|
/\"(\w+) \(?modifier\)?\"/, proc { |x| "k#{$1.upcase}_MOD" },
|
|
159
|
-
/\"(\w+)\"/,
|
|
165
|
+
/\"((?!k)\w+)\"/, proc { |x| "k#{$1.upcase}" },
|
|
160
166
|
|
|
161
167
|
/\$?@(\d+)(\s+|$)/, "", # newer bison
|
|
162
168
|
|
|
169
|
+
# 3.4(ish?) changes:
|
|
170
|
+
"option_tNL", "opt_nl",
|
|
171
|
+
"option_terms", "opt_terms",
|
|
172
|
+
|
|
163
173
|
# TODO: remove for 3.0 work:
|
|
164
174
|
"lex_ctxt ", "" # 3.0 production that's mostly noise right now
|
|
165
175
|
]
|
|
@@ -178,12 +188,16 @@ end
|
|
|
178
188
|
ARGF.each_line do |line|
|
|
179
189
|
next unless good or line =~ /^-* ?Grammar|\$accept : /
|
|
180
190
|
|
|
181
|
-
case line.strip
|
|
191
|
+
case line.strip # TODO: .delete %q["'()]
|
|
182
192
|
when /^$/ then
|
|
183
193
|
when /^(\d+) (\$?[@\w]+): (.*)/ then # yacc
|
|
184
194
|
rule = $2
|
|
185
195
|
order << rule unless rules.has_key? rule
|
|
186
196
|
rules[rule] << munge($3)
|
|
197
|
+
when /^(\d+) (\$?[@\w]+'(?: |\\n)'): (.*)/ then # munges both sides
|
|
198
|
+
rule = $2
|
|
199
|
+
order << rule unless rules.has_key? rule
|
|
200
|
+
rules[munge(rule)] << munge($3)
|
|
187
201
|
when /^(\d+) \s+\| (.*)/ then # yacc
|
|
188
202
|
rules[rule] << munge($2)
|
|
189
203
|
when /^(\d+) (@\d+): (.*)/ then # yacc
|
data/gauntlet.md
CHANGED
|
@@ -38,11 +38,11 @@ using `unpack_gems.rb`.
|
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
% cd RP/gauntlet
|
|
41
|
-
% time caffeinate
|
|
41
|
+
% time caffeinate ./bin/unpack_gems.rb -v [-a] ; say done
|
|
42
42
|
... waaaait ...
|
|
43
43
|
% DIR=gauntlet.$(today).(all|new).noindex
|
|
44
44
|
% mv hashed.noindex $DIR
|
|
45
|
-
% tar vc -T <(fd -tf . $DIR | sort) |
|
|
45
|
+
% tar vc -T <(fd -tf . $DIR | sort) | zstdmt -12 --long > archives/$DIR.tar.zst ; say done
|
|
46
46
|
% ./bin/sync.sh
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -71,7 +71,7 @@ compress).
|
|
|
71
71
|
### Stats
|
|
72
72
|
|
|
73
73
|
```
|
|
74
|
-
9696 %
|
|
74
|
+
9696 % fd -tf . gauntlet.$(today).noindex | wc -l
|
|
75
75
|
561270
|
|
76
76
|
3.5G gauntlet.2021-08-06.noindex
|
|
77
77
|
239M gauntlet.2021-08-06.noindex.tar.zst
|
|
@@ -85,9 +85,12 @@ parse. It's about 3.5g but compresses very nicely down to 240m
|
|
|
85
85
|
Assuming you're starting from scratch, unpack the archive once:
|
|
86
86
|
|
|
87
87
|
```
|
|
88
|
-
%
|
|
88
|
+
% tar xf gauntlet.$(today).noindex.tar.zst
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
+
(BSD tar (and apparently newer gnu tars) can detect and uncompress
|
|
92
|
+
most compression formats)
|
|
93
|
+
|
|
91
94
|
Then, either run a single process (easier to read):
|
|
92
95
|
|
|
93
96
|
```
|
|
@@ -103,5 +106,32 @@ Or max out your machine using xargs (note the `-P 16` and choose accordingly):
|
|
|
103
106
|
In another terminal I usually monitor the progress like so:
|
|
104
107
|
|
|
105
108
|
```
|
|
106
|
-
% while true ; do clear; fd . -
|
|
109
|
+
% while true ; do clear; fd . -td -te gauntlet/*.noindex -X rmdir -p 2> /dev/null ; for D in gauntlet/*.noindex/? ; do echo -n "$D: "; fd .rb $D | wc -l ; done ; echo ; sleep 30 ; done
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
After this is run and done, there will be files left over that
|
|
113
|
+
couldn't be parsed. There will also be a directory with a name like
|
|
114
|
+
`gauntlet.slow.1` of files that timed out. What I generally do is wait
|
|
115
|
+
for the first run to end and then start increasing the timeout and run
|
|
116
|
+
again on the timeout dir:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
$ ls -d gauntlet.slow.1/*.noindex/?/? | RP_TIMEOUT=30 time xargs -n 1 -P 16 ./gauntlet/bin/gauntlet.rb
|
|
120
|
+
# or:
|
|
121
|
+
$ RP_TIMEOUT=30 time ./gauntlet/bin/gauntlet.rb gauntlet.slow.*
|
|
122
|
+
$ RP_TIMEOUT=60 time ./gauntlet/bin/gauntlet.rb gauntlet.slow.*
|
|
123
|
+
$ fd -tf . gauntlet.slow.60/
|
|
124
|
+
gauntlet.slow.60/gauntlet.2025-10-22.new.noindex/2/f/f/2ff00bbd2ee63b2145d247570c130823dce2b9fe.rb
|
|
125
|
+
gauntlet.slow.60/gauntlet.2025-10-22.new.noindex/a/a/4/aa44d5a214217036425bf8fce5a7ab5b0e04fd92.rb
|
|
107
126
|
```
|
|
127
|
+
|
|
128
|
+
for the most part, you wind up with absurdly large generated ruby files:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
10022 $ wc -l gauntlet.slow.60/*/?/?/?/*.rb
|
|
132
|
+
412444 gauntlet.slow.60/gauntlet.2025-10-22.new.noindex/2/f/f/2ff00bbd2ee63b2145d247570c130823dce2b9fe.rb
|
|
133
|
+
295249 gauntlet.slow.60/gauntlet.2025-10-22.new.noindex/a/a/4/aa44d5a214217036425bf8fce5a7ab5b0e04fd92.rb
|
|
134
|
+
707693 total
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
and I don't care so much about these.
|
data/lib/ruby_lexer.rb
CHANGED
data/lib/ruby_parser.rb
CHANGED
|
@@ -38,7 +38,7 @@ class RubyParser
|
|
|
38
38
|
e ||= exc
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
|
-
raise e
|
|
41
|
+
raise RubyParser::SyntaxError, e.message
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
alias :parse :process
|
|
@@ -83,10 +83,12 @@ require "ruby_parser30"
|
|
|
83
83
|
require "ruby_parser31"
|
|
84
84
|
require "ruby_parser32"
|
|
85
85
|
require "ruby_parser33"
|
|
86
|
+
require "ruby_parser34"
|
|
86
87
|
|
|
87
88
|
class RubyParser # HACK
|
|
88
89
|
VERSIONS.clear # also a HACK caused by racc namespace issues
|
|
89
90
|
|
|
91
|
+
class V34 < ::Ruby34Parser; end
|
|
90
92
|
class V33 < ::Ruby33Parser; end
|
|
91
93
|
class V32 < ::Ruby32Parser; end
|
|
92
94
|
class V31 < ::Ruby31Parser; end
|
data/lib/ruby_parser2.yy
CHANGED
|
@@ -637,11 +637,11 @@ rule
|
|
|
637
637
|
|
|
638
638
|
mlhs_node: user_variable
|
|
639
639
|
{
|
|
640
|
-
result = self.
|
|
640
|
+
result = self.old_assignable val[0]
|
|
641
641
|
}
|
|
642
642
|
| keyword_variable
|
|
643
643
|
{
|
|
644
|
-
result = self.
|
|
644
|
+
result = self.old_assignable val[0]
|
|
645
645
|
}
|
|
646
646
|
| primary_value tLBRACK2 opt_call_args rbracket
|
|
647
647
|
{
|
|
@@ -698,13 +698,13 @@ rule
|
|
|
698
698
|
{
|
|
699
699
|
var, = val
|
|
700
700
|
|
|
701
|
-
result = self.
|
|
701
|
+
result = self.old_assignable var
|
|
702
702
|
}
|
|
703
703
|
| keyword_variable
|
|
704
704
|
{
|
|
705
705
|
var, = val
|
|
706
706
|
|
|
707
|
-
result = self.
|
|
707
|
+
result = self.old_assignable var
|
|
708
708
|
|
|
709
709
|
debug 16
|
|
710
710
|
}
|
|
@@ -2434,7 +2434,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
|
2434
2434
|
|
|
2435
2435
|
case lhs.sexp_type
|
|
2436
2436
|
when :lit then
|
|
2437
|
-
|
|
2437
|
+
old_assignable [lhs.value, lhs.line]
|
|
2438
2438
|
else
|
|
2439
2439
|
# TODO or done?
|
|
2440
2440
|
debug 666
|
|
@@ -2454,7 +2454,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
|
2454
2454
|
_, (id, line) = val
|
|
2455
2455
|
|
|
2456
2456
|
name = id.to_sym
|
|
2457
|
-
self.
|
|
2457
|
+
self.old_assignable [name, line]
|
|
2458
2458
|
result = s(:kwrest, :"**#{name}").line line
|
|
2459
2459
|
}
|
|
2460
2460
|
| kwrest_mark
|
|
@@ -2983,11 +2983,11 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
|
2983
2983
|
|
|
2984
2984
|
var_lhs: user_variable
|
|
2985
2985
|
{
|
|
2986
|
-
result = self.
|
|
2986
|
+
result = self.old_assignable val[0]
|
|
2987
2987
|
}
|
|
2988
2988
|
| keyword_variable
|
|
2989
2989
|
{
|
|
2990
|
-
result = self.
|
|
2990
|
+
result = self.old_assignable val[0]
|
|
2991
2991
|
debug 40
|
|
2992
2992
|
}
|
|
2993
2993
|
|
|
@@ -3291,7 +3291,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
|
3291
3291
|
_, (id, line) = val
|
|
3292
3292
|
|
|
3293
3293
|
name = id.to_sym
|
|
3294
|
-
self.
|
|
3294
|
+
self.old_assignable [name, line]
|
|
3295
3295
|
result = [:"**#{name}", line]
|
|
3296
3296
|
}
|
|
3297
3297
|
| kwrest_mark
|
|
@@ -3310,7 +3310,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
|
3310
3310
|
#endif
|
|
3311
3311
|
{
|
|
3312
3312
|
lhs, _, rhs = val
|
|
3313
|
-
result = self.
|
|
3313
|
+
result = self.old_assignable lhs, rhs
|
|
3314
3314
|
# TODO: detect duplicate names
|
|
3315
3315
|
}
|
|
3316
3316
|
|
|
@@ -3323,7 +3323,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
|
3323
3323
|
#endif
|
|
3324
3324
|
{
|
|
3325
3325
|
lhs, _, rhs = val
|
|
3326
|
-
result = self.
|
|
3326
|
+
result = self.old_assignable lhs, rhs
|
|
3327
3327
|
}
|
|
3328
3328
|
|
|
3329
3329
|
f_block_optarg: f_block_opt
|
|
@@ -3355,7 +3355,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
|
3355
3355
|
# TODO: differs from parse.y - needs tests
|
|
3356
3356
|
_, (id, line) = val
|
|
3357
3357
|
name = id.to_sym
|
|
3358
|
-
self.
|
|
3358
|
+
self.old_assignable [name, line]
|
|
3359
3359
|
result = [:"*#{name}", line]
|
|
3360
3360
|
}
|
|
3361
3361
|
| restarg_mark
|
data/lib/ruby_parser20.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#
|
|
4
4
|
# DO NOT MODIFY!!!!
|
|
5
|
-
# This file is automatically generated by Racc 1.
|
|
5
|
+
# This file is automatically generated by Racc 1.8.1
|
|
6
6
|
# from Racc grammar file "stdin".
|
|
7
7
|
#
|
|
8
8
|
|
|
@@ -7955,13 +7955,13 @@ def _reduce_99(val, _values, result)
|
|
|
7955
7955
|
end
|
|
7956
7956
|
|
|
7957
7957
|
def _reduce_100(val, _values, result)
|
|
7958
|
-
result = self.
|
|
7958
|
+
result = self.old_assignable val[0]
|
|
7959
7959
|
|
|
7960
7960
|
result
|
|
7961
7961
|
end
|
|
7962
7962
|
|
|
7963
7963
|
def _reduce_101(val, _values, result)
|
|
7964
|
-
result = self.
|
|
7964
|
+
result = self.old_assignable val[0]
|
|
7965
7965
|
|
|
7966
7966
|
result
|
|
7967
7967
|
end
|
|
@@ -8033,7 +8033,7 @@ end
|
|
|
8033
8033
|
def _reduce_109(val, _values, result)
|
|
8034
8034
|
var, = val
|
|
8035
8035
|
|
|
8036
|
-
result = self.
|
|
8036
|
+
result = self.old_assignable var
|
|
8037
8037
|
|
|
8038
8038
|
result
|
|
8039
8039
|
end
|
|
@@ -8041,7 +8041,7 @@ end
|
|
|
8041
8041
|
def _reduce_110(val, _values, result)
|
|
8042
8042
|
var, = val
|
|
8043
8043
|
|
|
8044
|
-
result = self.
|
|
8044
|
+
result = self.old_assignable var
|
|
8045
8045
|
|
|
8046
8046
|
debug 16
|
|
8047
8047
|
|
|
@@ -10393,13 +10393,13 @@ def _reduce_531(val, _values, result)
|
|
|
10393
10393
|
end
|
|
10394
10394
|
|
|
10395
10395
|
def _reduce_532(val, _values, result)
|
|
10396
|
-
result = self.
|
|
10396
|
+
result = self.old_assignable val[0]
|
|
10397
10397
|
|
|
10398
10398
|
result
|
|
10399
10399
|
end
|
|
10400
10400
|
|
|
10401
10401
|
def _reduce_533(val, _values, result)
|
|
10402
|
-
result = self.
|
|
10402
|
+
result = self.old_assignable val[0]
|
|
10403
10403
|
debug 40
|
|
10404
10404
|
|
|
10405
10405
|
result
|
|
@@ -10703,7 +10703,7 @@ def _reduce_581(val, _values, result)
|
|
|
10703
10703
|
_, (id, line) = val
|
|
10704
10704
|
|
|
10705
10705
|
name = id.to_sym
|
|
10706
|
-
self.
|
|
10706
|
+
self.old_assignable [name, line]
|
|
10707
10707
|
result = [:"**#{name}", line]
|
|
10708
10708
|
|
|
10709
10709
|
result
|
|
@@ -10719,7 +10719,7 @@ end
|
|
|
10719
10719
|
|
|
10720
10720
|
def _reduce_583(val, _values, result)
|
|
10721
10721
|
lhs, _, rhs = val
|
|
10722
|
-
result = self.
|
|
10722
|
+
result = self.old_assignable lhs, rhs
|
|
10723
10723
|
# TODO: detect duplicate names
|
|
10724
10724
|
|
|
10725
10725
|
result
|
|
@@ -10727,7 +10727,7 @@ end
|
|
|
10727
10727
|
|
|
10728
10728
|
def _reduce_584(val, _values, result)
|
|
10729
10729
|
lhs, _, rhs = val
|
|
10730
|
-
result = self.
|
|
10730
|
+
result = self.old_assignable lhs, rhs
|
|
10731
10731
|
|
|
10732
10732
|
result
|
|
10733
10733
|
end
|
|
@@ -10768,7 +10768,7 @@ def _reduce_591(val, _values, result)
|
|
|
10768
10768
|
# TODO: differs from parse.y - needs tests
|
|
10769
10769
|
_, (id, line) = val
|
|
10770
10770
|
name = id.to_sym
|
|
10771
|
-
self.
|
|
10771
|
+
self.old_assignable [name, line]
|
|
10772
10772
|
result = [:"*#{name}", line]
|
|
10773
10773
|
|
|
10774
10774
|
result
|
data/lib/ruby_parser21.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#
|
|
4
4
|
# DO NOT MODIFY!!!!
|
|
5
|
-
# This file is automatically generated by Racc 1.
|
|
5
|
+
# This file is automatically generated by Racc 1.8.1
|
|
6
6
|
# from Racc grammar file "stdin".
|
|
7
7
|
#
|
|
8
8
|
|
|
@@ -7955,13 +7955,13 @@ def _reduce_98(val, _values, result)
|
|
|
7955
7955
|
end
|
|
7956
7956
|
|
|
7957
7957
|
def _reduce_99(val, _values, result)
|
|
7958
|
-
result = self.
|
|
7958
|
+
result = self.old_assignable val[0]
|
|
7959
7959
|
|
|
7960
7960
|
result
|
|
7961
7961
|
end
|
|
7962
7962
|
|
|
7963
7963
|
def _reduce_100(val, _values, result)
|
|
7964
|
-
result = self.
|
|
7964
|
+
result = self.old_assignable val[0]
|
|
7965
7965
|
|
|
7966
7966
|
result
|
|
7967
7967
|
end
|
|
@@ -8033,7 +8033,7 @@ end
|
|
|
8033
8033
|
def _reduce_108(val, _values, result)
|
|
8034
8034
|
var, = val
|
|
8035
8035
|
|
|
8036
|
-
result = self.
|
|
8036
|
+
result = self.old_assignable var
|
|
8037
8037
|
|
|
8038
8038
|
result
|
|
8039
8039
|
end
|
|
@@ -8041,7 +8041,7 @@ end
|
|
|
8041
8041
|
def _reduce_109(val, _values, result)
|
|
8042
8042
|
var, = val
|
|
8043
8043
|
|
|
8044
|
-
result = self.
|
|
8044
|
+
result = self.old_assignable var
|
|
8045
8045
|
|
|
8046
8046
|
debug 16
|
|
8047
8047
|
|
|
@@ -10394,13 +10394,13 @@ def _reduce_533(val, _values, result)
|
|
|
10394
10394
|
end
|
|
10395
10395
|
|
|
10396
10396
|
def _reduce_534(val, _values, result)
|
|
10397
|
-
result = self.
|
|
10397
|
+
result = self.old_assignable val[0]
|
|
10398
10398
|
|
|
10399
10399
|
result
|
|
10400
10400
|
end
|
|
10401
10401
|
|
|
10402
10402
|
def _reduce_535(val, _values, result)
|
|
10403
|
-
result = self.
|
|
10403
|
+
result = self.old_assignable val[0]
|
|
10404
10404
|
debug 40
|
|
10405
10405
|
|
|
10406
10406
|
result
|
|
@@ -10728,7 +10728,7 @@ def _reduce_586(val, _values, result)
|
|
|
10728
10728
|
_, (id, line) = val
|
|
10729
10729
|
|
|
10730
10730
|
name = id.to_sym
|
|
10731
|
-
self.
|
|
10731
|
+
self.old_assignable [name, line]
|
|
10732
10732
|
result = [:"**#{name}", line]
|
|
10733
10733
|
|
|
10734
10734
|
result
|
|
@@ -10744,7 +10744,7 @@ end
|
|
|
10744
10744
|
|
|
10745
10745
|
def _reduce_588(val, _values, result)
|
|
10746
10746
|
lhs, _, rhs = val
|
|
10747
|
-
result = self.
|
|
10747
|
+
result = self.old_assignable lhs, rhs
|
|
10748
10748
|
# TODO: detect duplicate names
|
|
10749
10749
|
|
|
10750
10750
|
result
|
|
@@ -10752,7 +10752,7 @@ end
|
|
|
10752
10752
|
|
|
10753
10753
|
def _reduce_589(val, _values, result)
|
|
10754
10754
|
lhs, _, rhs = val
|
|
10755
|
-
result = self.
|
|
10755
|
+
result = self.old_assignable lhs, rhs
|
|
10756
10756
|
|
|
10757
10757
|
result
|
|
10758
10758
|
end
|
|
@@ -10793,7 +10793,7 @@ def _reduce_596(val, _values, result)
|
|
|
10793
10793
|
# TODO: differs from parse.y - needs tests
|
|
10794
10794
|
_, (id, line) = val
|
|
10795
10795
|
name = id.to_sym
|
|
10796
|
-
self.
|
|
10796
|
+
self.old_assignable [name, line]
|
|
10797
10797
|
result = [:"*#{name}", line]
|
|
10798
10798
|
|
|
10799
10799
|
result
|