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

@ -38,6 +38,9 @@ module Vool
def slot_definition(method)
return Mom::SlotDefinition.new(Parfait.object_space.true_object , [])
end
def to_s(depth = 0)
"true"
end
end
class FalseConstant < Constant
def ct_type
@ -46,6 +49,9 @@ module Vool
def slot_definition(method)
return Mom::SlotDefinition.new(Parfait.object_space.false_object , [])
end
def to_s(depth = 0)
"false"
end
end
class NilConstant < Constant
def ct_type
@ -54,6 +60,9 @@ module Vool
def slot_definition(method)
return Mom::SlotDefinition.new(Parfait.object_space.nil_object , [])
end
def to_s(depth = 0)
"nil"
end
end
class SelfExpression < Expression
attr_reader :my_type
@ -67,11 +76,14 @@ module Vool
def ct_type
@my_type
end
def to_s
def to_s(depth = 0)
"self"
end
end
class SuperExpression < Statement
def to_s(depth = 0)
"super"
end
end
class StringConstant < Constant
attr_reader :value
@ -84,6 +96,9 @@ module Vool
def ct_type
Parfait.object_space.get_class_by_name(:Word).instance_type
end
def to_s(depth = 0)
"'#{@value}'"
end
end
class SymbolConstant < StringConstant
def ct_type