Permalink
Browse files

resolve conflict; ref #3285

  • Loading branch information...
matz committed Nov 25, 2016
2 parents 0d48a97 + 1253982 commit cc2786c84e048123e4bce40cf4ea06ac172de5a4
Showing with 20 additions and 0 deletions.
  1. +2 −0 mrbgems/mruby-compiler/core/codegen.c
  2. +18 −0 test/t/codegen.rb
@@ -2030,6 +2030,7 @@ codegen(codegen_scope *s, node *tree, int val)
}
genop(s, MKOP_sBx(OP_JMP, s->loop->pc2 - s->pc));
}
if (val) push();
break;
case NODE_RETRY:
@@ -2064,6 +2065,7 @@ codegen(codegen_scope *s, node *tree, int val)
genop(s, MKOP_sBx(OP_JMP, lp->pc1 - s->pc));
}
}
if (val) push();
}
break;
View
@@ -13,3 +13,21 @@ def method
assert('empty condition in ternary expression parses correctly') do
assert_equal(() ? 1 : 2, 2)
end
assert('codegen absorbs arguments to redo and retry if they are the argument of a call') do
assert_nothing_raised do
a=*"1", case nil
when 1
redo |
1
end
end
assert_nothing_raised do
a=*"1", case nil
when 1
retry |
1
end
end
end

0 comments on commit cc2786c

Please sign in to comment.