2019-10-03 23:36:49 +02:00
|
|
|
module Sol
|
2018-06-29 21:46:39 +02:00
|
|
|
|
2019-08-16 19:39:08 +02:00
|
|
|
# Local assignment really only differs in where the variable is actually stored,
|
|
|
|
# slot_position defines that
|
2018-06-29 21:46:39 +02:00
|
|
|
class LocalAssignment < Assignment
|
|
|
|
|
2019-08-16 19:39:08 +02:00
|
|
|
# We return the position where the local is stored. This is an array, giving the
|
|
|
|
# position relative to :message- A SlotLoad is constructed from this.
|
|
|
|
#
|
|
|
|
# Only snag is that we do not know this position, as only the compiler knows
|
|
|
|
# if the variable name is a local or an arg. So we delegate to the compiler.
|
|
|
|
def slot_position( compiler )
|
2019-08-22 20:24:02 +02:00
|
|
|
slot = compiler.slot_type_for(@name)
|
|
|
|
#puts "SLOT= #{slot}"
|
|
|
|
slot
|
2018-06-29 21:46:39 +02:00
|
|
|
end
|
2019-08-07 14:08:45 +02:00
|
|
|
|
2018-06-29 21:46:39 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|