block creation and insertion with correct types

This commit is contained in:
Torsten Ruger
2018-07-07 22:42:00 +03:00
parent 1913848910
commit 0d900de695
4 changed files with 32 additions and 10 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 = {}