Skip to content
Permalink
Browse files
resolve conflict; ref #3279
  • Loading branch information
matz committed Nov 25, 2016
2 parents d3ff9d3 + 73e4f06 commit 55842c5a3482d507bae16f14f563a5eadfa0b720
Showing 3 changed files with 14 additions and 2 deletions.
@@ -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 @@ def args_to_ary(*args)
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

0 comments on commit 55842c5

Please sign in to comment.