Skip to content

Commit

Permalink
Support 'redo' keyword inside blocks/iters
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Sep 20, 2013
1 parent fc58796 commit eafbb58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/opal/parser.rb
Expand Up @@ -409,7 +409,7 @@ def returns(sexp)
return returns s(:nil) unless sexp

case sexp.first
when :break, :next
when :break, :next, :redo
sexp
when :yield
sexp[0] = :returnable_yield
Expand Down Expand Up @@ -2315,6 +2315,8 @@ def process_redo(exp, level)
if in_while?
@while_loop[:use_redo] = true
f("#{@while_loop[:redo_var]} = true", exp)
elsif @scope.iter?
f("return #{@scope.identity}.apply(null, [])")
else
f("REDO()", exp)
end
Expand Down
4 changes: 0 additions & 4 deletions spec/filters/bugs/language/loop.rb

This file was deleted.

0 comments on commit eafbb58

Please sign in to comment.