fix assembler recursion
This commit is contained in:
parent
50af6a8f41
commit
726a514c9e
@ -50,6 +50,7 @@ module Register
|
|||||||
assemble_object( slot.object )
|
assemble_object( slot.object )
|
||||||
end
|
end
|
||||||
puts "Assembled #{@stream.length}"
|
puts "Assembled #{@stream.length}"
|
||||||
|
return @stream.string
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_object(object)
|
def link_object(object)
|
||||||
@ -102,7 +103,7 @@ module Register
|
|||||||
array = slot.object
|
array = slot.object
|
||||||
layout = slot.layout
|
layout = slot.layout
|
||||||
@stream.write_uint32( 0 ) #TODO types
|
@stream.write_uint32( 0 ) #TODO types
|
||||||
@stream.write_uint32( assemble_object(layout[:names]) ) #ref
|
write_ref layout[:names] #ref
|
||||||
array.each do |var|
|
array.each do |var|
|
||||||
write_ref(var)
|
write_ref(var)
|
||||||
end
|
end
|
||||||
@ -180,21 +181,21 @@ module Register
|
|||||||
return link_String(sc.string)
|
return link_String(sc.string)
|
||||||
end
|
end
|
||||||
|
|
||||||
def assemble_String( str )
|
def assemble_String( slot )
|
||||||
slot = get_slot(str)
|
str = slot.object
|
||||||
raise "String not linked #{str}" unless slot
|
|
||||||
layout = slot.layout
|
layout = slot.layout
|
||||||
@stream.write_uint32( 0 ) #TODO types
|
@stream.write_uint32( 0 ) #TODO types
|
||||||
@stream.write_uint32( assemble_object(layout[:names]) ) #ref
|
@stream.write_uint32( assemble_object(layout[:names]) ) #ref
|
||||||
@stream.write str
|
@stream.write str
|
||||||
|
#TODO write padding 0's
|
||||||
end
|
end
|
||||||
|
|
||||||
def assemble_Symbol(sym)
|
def assemble_Symbol(sym)
|
||||||
return assemble_String(sym.to_s)
|
return assemble_String(sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
def assemble_StringConstant( sc)
|
def assemble_StringConstant( sc)
|
||||||
return assemble_String(sc.string)
|
return assemble_String(sc)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Loading…
x
Reference in New Issue
Block a user