give labels an integer that will end up being the position at runtime
Since integers are first class objects, we need to use an integer object as the return address. The actual address can not be stored in an instance variable since it is not an object. The address is unique to the label and never changes after positioning (using the int is next up)
This commit is contained in:
@ -11,7 +11,8 @@ module Mom
|
||||
@value = value
|
||||
end
|
||||
def to_parfait(compiler)
|
||||
value = Parfait::Integer.new(@value)
|
||||
value = Parfait.object_space.get_integer
|
||||
value.set_value(@value)
|
||||
compiler.add_constant(value)
|
||||
value
|
||||
end
|
||||
|
Reference in New Issue
Block a user