Adding simple implicit return
Ruby return semantics are easy to grasp, not so easy to code. So many cases. Added support for common cases, return const/variable or call.
This commit is contained in:
@ -29,7 +29,9 @@ module Vool
|
||||
end
|
||||
|
||||
def to_s(depth = 0)
|
||||
at_depth(depth , "while (#{@condition})" , @body.to_s(depth + 1) , "end" )
|
||||
lines =[ "while (#{@condition})" , @body.to_s(1) , "end"]
|
||||
lines.unshift( @hoisted.to_s) if @hoisted
|
||||
at_depth(depth , *lines )
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user