first risc level block test working

assign was not executing yield
baecause it was just testing for send, instead of callable
This commit is contained in:
Torsten Ruger
2018-07-30 20:11:52 +03:00
parent 1d2ec8e8ac
commit 4fe0edd1e3
6 changed files with 77 additions and 25 deletions

View File

@ -23,7 +23,7 @@ module Ruby
end
def normalize_arg(arg , arguments , statements)
if arg.is_a?(Constant) and !arg.is_a?(SendStatement)
if arg.is_a?(Constant) and !arg.is_a?(CallStatement)
arguments << arg.to_vool
return
end

View File

@ -16,7 +16,7 @@ module Vool
end
def chain_assign(assign , compiler)
return assign unless @value.is_a?(SendStatement)
return assign unless @value.is_a?(CallStatement)
@value.to_mom(compiler) << assign
end
end

View File

@ -8,7 +8,7 @@ module Vool
# On the way down to Mom, small differences become abvious, as the block that is
# yielded to is an argument. Whereas in a send it is either statically known
# or resolved and cached. Here it is dynamic, but sort of known dynamic.
# All we do before calling it is check that it is the right type.
# All we do before calling it is check that it is the right type.
class YieldStatement < CallStatement
# A Yield breaks down to 2 steps: