Commit 1329529f authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge branch 'bouk-nested-empty-heredoc'

parents d3ff9d31 55842c5a
......@@ -2295,7 +2295,11 @@ codegen(codegen_scope *s, node *tree, int val)
if (val) {
node *n = tree;
if (!n) break;
if (!n) {
genop(s, MKOP_A(OP_LOADNIL, cursp()));
push();
break;
}
codegen(s, n->car, VAL);
n = n->cdr;
while (n) {
......
......@@ -6541,7 +6541,7 @@ mrb_parser_dump(mrb_state *mrb, node *tree, int offset)
case NODE_HEREDOC:
printf("NODE_HEREDOC (<<%s):\n", ((parser_heredoc_info*)tree)->term);
mrb_parser_dump(mrb, ((parser_heredoc_info*)tree)->doc, offset+1);
dump_recur(mrb, ((parser_heredoc_info*)tree)->doc, offset+1);
break;
default:
......
......@@ -46,3 +46,11 @@ assert('method call with exactly 127 arguments') do
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
)
end
assert('nested empty heredoc') do
_, a = nil, <<B
#{<<A}
A
B
assert_equal "\n", a
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment