random tries
This commit is contained in:
@ -31,12 +31,9 @@ module Mom
|
||||
left = SlotDefinition.new(left.shift , left) if left.is_a? Array
|
||||
@left , @right = left , right
|
||||
raise "left not SlotDefinition, #{left}" unless left.is_a? SlotDefinition
|
||||
raise "right not Mom, #{right.to_rxf}" unless right.class.name.include?("Mom")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class SlotDefinition
|
||||
attr_reader :known_object , :slots
|
||||
def initialize( object , slots)
|
||||
|
@ -5,11 +5,17 @@ module Mom
|
||||
|
||||
def initialize(left , right)
|
||||
right = SlotDefinition.new(right.shift , right) if right.is_a? Array
|
||||
raise "right not Mom, #{right.to_s}" unless right.is_a?( SlotDefinition )
|
||||
super(left , right)
|
||||
end
|
||||
|
||||
|
||||
def to_risc(context)
|
||||
Risc::Label.new(self,"SlotMove")
|
||||
reg = context.use_reg(:int)#( @right.ct_type)
|
||||
const = Risc.load_constant(self, @right , reg)
|
||||
# const.set_next Risc.reg_to_slot(self, reg , @left.known_object, @left.slots.first)
|
||||
# context.release_reg(reg)
|
||||
return const
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user