Redoing ruby block conversion

Since the block is actually a constant, it does not need assignment or special hoisting
Just use the send and stick the lambda in as last arg
This commit is contained in:
2019-08-19 14:23:55 +03:00
parent f87526f86f
commit 3ddf2e3837
7 changed files with 37 additions and 72 deletions

View File

@ -39,9 +39,7 @@ module Ruby
# rather than using a stack to do that at runtime
def normalize_arg(arg , statements)
vool_arg = arg.to_vool
if arg.is_a?(Variable) || arg.is_a?(Constant)
return vool_arg
end
return vool_arg if vool_arg.is_a?(Vool::Expression)
if( vool_arg.is_a?(Vool::Statements))
while(vool_arg.length > 1)
statements << vool_arg.shift