misc to_s and small fixes

This commit is contained in:
Torsten Ruger
2018-07-04 08:28:29 +03:00
parent 8b9fd29ce9
commit 6f936f190d
13 changed files with 46 additions and 21 deletions

View File

@ -39,5 +39,8 @@ module Parfait
index = @type.get_index(name)
get_at(index)
end
def to_s
"Message:#{name}(#{arguments.get_length})"
end
end
end

View File

@ -23,6 +23,13 @@
module Parfait
class NamedList < Object
def to_s
str = "NamedList len= #{get_length}"
str += " at #{Risc::Position.get(self)}" if Risc::Position.set?(self)
end
def get_length
get_type.get_length - 1
end
def self.type_for( arguments )
my_class = Parfait.object_space.classes[:NamedList]
Type.for_hash( my_class , {type: my_class.instance_type}.merge(arguments))