@@ -14,7 +14,7 @@ Hoe.add_include_dirs "../../oedipus_lex/dev/lib"
14
14
Hoe . add_include_dirs "../../ruby2ruby/dev/lib"
15
15
16
16
V2 = %w[ 20 21 22 23 24 25 26 27 ]
17
- V3 = %w[ 30 31 32 33 ]
17
+ V3 = %w[ 30 31 32 33 34 ]
18
18
19
19
VERS = V2 + V3
20
20
@@ -164,7 +164,7 @@ def ruby_parse version
164
164
desc "fetch all tarballs"
165
165
task :fetch => tarball
166
166
167
- file parse_y => tarball do
167
+ file ruby_dir => tarball do
168
168
extract_glob = case
169
169
when version > "3.3" then
170
170
"{id.h,parse.y,tool/{id2token.rb,lrama},defs/id.def}"
@@ -176,15 +176,20 @@ def ruby_parse version
176
176
"{id.h,parse.y,tool/{id2token.rb,vpath.rb}}"
177
177
end
178
178
system "tar xf #{ tarball } -C compare #{ File . basename ruby_dir } /#{ extract_glob } "
179
+ end
180
+
181
+ file parse_y => ruby_dir do
182
+ # env -u RUBYOPT rake compare/parse33.y
183
+ warn "Warning: RUBYOPT is set! Use 'env -u RUBYOPT rake'" if ENV [ "RUBYOPT" ]
179
184
180
185
# Debugging a new parse build system:
181
186
#
182
187
# Unpack the ruby tarball in question, configure, and run the following:
183
188
#
184
- # % touch parse.y ; make -n parse.c
189
+ # % [ -e Makefile ] || ./configure ; make -n -W parse.y parse.c
185
190
# ...
186
191
# echo generating parse.c
187
- # /Users/ryan/.rubies.current/bin/ ruby --disable=gems ./tool/id2token.rb parse.y | \
192
+ # ruby --disable=gems ./tool/id2token.rb parse.y | \
188
193
# ruby ./tool/lrama/exe/lrama -oparse.c -Hparse.h - parse.y
189
194
#
190
195
# Then integrate these commands into the mess below:
@@ -197,12 +202,6 @@ def ruby_parse version
197
202
end
198
203
199
204
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
205
end
207
206
208
207
bison = Dir [ "/opt/homebrew/opt/bison/bin/bison" ,
@@ -211,8 +210,9 @@ def ruby_parse version
211
210
] . first
212
211
213
212
file mri_txt => [ parse_y , normalize ] do
213
+ d = ruby_dir
214
214
if version > "3.3" then
215
- sh "./compare/ lrama/exe/lrama -r all -ocompare/parse#{ v } .tab.c #{ parse_y } "
215
+ sh "./#{ d } /tool/ lrama/exe/lrama -r states --report-file=compare/parse #{ v } .output -ocompare/parse#{ v } .tab.c #{ parse_y } "
216
216
else
217
217
sh "#{ bison } -r all #{ parse_y } "
218
218
mv Dir [ "parse#{ v } .*" ] , "compare"
@@ -247,7 +247,7 @@ def ruby_parse version
247
247
end
248
248
249
249
task :clean do
250
- rm_f Dir [ mri_txt , rp_txt ]
250
+ rm_f Dir [ mri_txt , rp_txt , ruby_dir ]
251
251
end
252
252
253
253
task :realclean do
@@ -296,9 +296,10 @@ ruby_parse "2.5.9"
296
296
ruby_parse "2.6.10"
297
297
ruby_parse "2.7.8"
298
298
ruby_parse "3.0.6"
299
- ruby_parse "3.1.4"
300
- ruby_parse "3.2.2"
301
- ruby_parse "3.3.0"
299
+ ruby_parse "3.1.7"
300
+ ruby_parse "3.2.8"
301
+ ruby_parse "3.3.7"
302
+ ruby_parse "3.4.2"
302
303
303
304
task :debug => :isolate do
304
305
ENV [ "V" ] ||= VERS . last
0 commit comments