sort objects by class before positioning
since we don’t have pages yet, but want consistent layout
This commit is contained in:
@ -27,6 +27,9 @@ module Parfait
|
||||
type_length
|
||||
end
|
||||
|
||||
def to_s
|
||||
"Integer #{@value}"
|
||||
end
|
||||
# compile time method to set the actual value.
|
||||
# this should not really be part of parfait, as ints are immutable at runtime.
|
||||
def set_value(value)
|
||||
|
@ -84,7 +84,8 @@ module Risc
|
||||
# return final position that is stored in code_start
|
||||
def position_objects(at)
|
||||
# want to have the objects first in the executable
|
||||
objects.each do | id , objekt|
|
||||
sorted = objects.values.sort{|left,right| left.class.name <=> right.class.name}
|
||||
sorted.each do | objekt|
|
||||
next if objekt.is_a?( Parfait::BinaryCode) or objekt.is_a?( Risc::Label )
|
||||
before = at
|
||||
Position.set(objekt,at)
|
||||
|
Reference in New Issue
Block a user