block creation and insertion with correct types
This commit is contained in:
@ -38,7 +38,10 @@ module Parfait
|
||||
end
|
||||
|
||||
def create_block(args , frame)
|
||||
bl = Block.new(self_type , args , frame)
|
||||
add_block( Block.new(self_type , args , frame))
|
||||
end
|
||||
|
||||
def add_block(bl)
|
||||
block = self.blocks
|
||||
bl.next = block if(block)
|
||||
@blocks = bl
|
||||
|
@ -45,7 +45,7 @@ module Risc
|
||||
method = type.create_method( method_name , args , frame)
|
||||
self.new(method)
|
||||
end
|
||||
|
||||
|
||||
# convert the given mom instruction to_risc and then add it (see add_code)
|
||||
# continue down the instruction chain unti depleted
|
||||
# (adding moves the insertion point so the whole mom chain is added as a risc chain)
|
||||
|
@ -15,7 +15,6 @@ module Vool
|
||||
# fact never called)
|
||||
def slot_definition(compiler)
|
||||
@parfait_block = to_parfait(compiler)
|
||||
compiler.add_constant(@parfait_block)
|
||||
return Mom::SlotDefinition.new(Mom::IntegerConstant.new(1) , [])
|
||||
end
|
||||
|
||||
@ -34,7 +33,7 @@ module Vool
|
||||
|
||||
private
|
||||
def to_parfait(compiler)
|
||||
Parfait::Block.new(compiler.method.self_type , make_arg_type , make_frame)
|
||||
compiler.method.create_block( make_arg_type , make_frame)
|
||||
end
|
||||
def make_arg_type( )
|
||||
type_hash = {}
|
||||
|
Reference in New Issue
Block a user