Commit 21a950ef
21a950efea35Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 19 files · +2 added · ~1 modified · -16 deleted
Description
test: bundle 8 small standalone tests into bundle_misc_c_35 + fix ForNode in method body
Fold 8 short standalone tests (array_mul_string, for_multi_var,
symbol_inspect_spl_marker, split_no_arg_ws, scalar_zero_truthiness,
reduce_sym_op, array_of_hash_lit, integer_div) into a single
bundled file. Each test wrapped in def t_<name>; ...; end
followed by an explicit t_<name> call so its locals don't leak
to the bundle's main scope. Cuts 8 spinel_parse + spinel_analyze
- spinel_codegen + cc + link cycles on every test run; the bundle compiles in roughly the time of a single standalone.
Bundling for_multi_var uncovered a separate ForNode-in-method-
body bug: compile_body_return_inner's last-statement dispatch had
arms for WhileNode / UntilNode but not ForNode, so a method body
ending in a for x, y, z in ...; ...; end was silently dropped
from the emit (def t; for x,y,z in [...]; end; end produced an
empty function body). Add the missing ForNode arm parallel to
WhileNode -- compile the for-loop then return the type's default.
Tests: default 455/0/0 (was 463, -8 standalone + the previously- counted bundle).
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- 21a950efea35
- Parent
- d903820a0c43
spinel_codegen.rbmodifiedView file
end return end if @nd_type[last] == "ForNode" compile_for_stmt(last) if return_type != "void" emit(" return " + c_return_default(return_type) + ";") end return end if @nd_type[last] == "YieldNode" compile_yield_stmt(last) if return_type != "void"test/array_mul_string.rbdeleted
Loading diff…
test/array_mul_string.rb.expecteddeleted
Loading diff…
test/array_of_hash_lit.rbdeleted
Loading diff…
test/array_of_hash_lit.rb.expecteddeleted
Loading diff…
test/bundle_misc_c_35.rbaddedView file
Loading diff…
test/bundle_misc_c_35.rb.expectedaddedView file
Loading diff…
test/for_multi_var.rbdeleted
Loading diff…
test/for_multi_var.rb.expecteddeleted
Loading diff…
test/integer_div.rbdeleted
Loading diff…
test/integer_div.rb.expecteddeleted
Loading diff…
test/reduce_sym_op.rbdeleted
Loading diff…
test/reduce_sym_op.rb.expecteddeleted
Loading diff…
test/scalar_zero_truthiness.rbdeleted
Loading diff…
test/scalar_zero_truthiness.rb.expecteddeleted
Loading diff…
test/split_no_arg_ws.rbdeleted
Loading diff…
test/split_no_arg_ws.rb.expecteddeleted
Loading diff…
test/symbol_inspect_spl_marker.rbdeleted
Loading diff…
test/symbol_inspect_spl_marker.rb.expecteddeleted
Loading diff…