lib/ruby2js/converter/next.rb in ruby2js-4.0.1 vs lib/ruby2js/converter/next.rb in ruby2js-4.0.2
- old
+ new
@@ -3,10 +3,18 @@
# (next
# (int 1))
handle :next do |n=nil|
- raise Error.new("next argument #{ n.inspect }", @ast) if n
- put @next_token.to_s
+ if @next_token == :return
+ put 'return'
+ if n
+ put ' '
+ parse n
+ end
+ else
+ raise Error.new("next argument #{ n.inspect }", @ast) if n
+ put @next_token.to_s
+ end
end
end
end