more test fixes and more to do

This commit is contained in:
2019-08-10 21:59:31 +03:00
parent 213938075f
commit 0b59c95218
17 changed files with 58 additions and 47 deletions

View File

@ -6,7 +6,10 @@ module Mom
class BlockYield < Instruction
attr :arg_index
def initialize(index)
# pass in the source (vool statement) and the index.
# The index is the argument index of the block that we call
def initialize(source , index)
super(source)
@arg_index = index
end
@ -14,6 +17,7 @@ module Mom
"BlockYield[#{arg_index}] "
end
# almost as simple as a SimpleCall, use a dynamic_jump to get there
def to_risc(compiler)
return_label = Risc.label("block_yield", "continue_#{object_id}")
index = arg_index

View File

@ -15,7 +15,11 @@ module Mom
class ResolveMethod < Instruction
attr :cache_entry , :name
def initialize(name , cache_entry)
# pass in source (VoolStatement)
# name of the method (don't knwow the actaual method)
# and the cache_entry
def initialize(source , name , cache_entry)
super(source)
@name = name
@cache_entry = cache_entry
end