Torsten Rüger
d1f8733623
Simple is really the descriptive name for the layer Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified) Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else Just cause i was renaming anyway
59 lines
1.0 KiB
Ruby
59 lines
1.0 KiB
Ruby
module Ruby
|
|
class Constant < Statement
|
|
def to_sol
|
|
sol_brother.new
|
|
end
|
|
end
|
|
class ValueConstant < Constant
|
|
attr_reader :value
|
|
def initialize(value)
|
|
@value = value
|
|
end
|
|
def to_sol
|
|
sol_brother.new(@value)
|
|
end
|
|
end
|
|
class IntegerConstant < ValueConstant
|
|
def to_s
|
|
value.to_s
|
|
end
|
|
end
|
|
class FloatConstant < ValueConstant
|
|
attr_reader :value
|
|
def initialize(value)
|
|
@value = value
|
|
end
|
|
end
|
|
class TrueConstant < Constant
|
|
def to_s(depth = 0)
|
|
"true"
|
|
end
|
|
end
|
|
class FalseConstant < Constant
|
|
def to_s(depth = 0)
|
|
"false"
|
|
end
|
|
end
|
|
class NilConstant < Constant
|
|
def to_s(depth = 0)
|
|
"nil"
|
|
end
|
|
end
|
|
class SelfExpression < Constant
|
|
def to_s(depth = 0)
|
|
"self"
|
|
end
|
|
end
|
|
class StringConstant < ValueConstant
|
|
attr_reader :value
|
|
def initialize(value)
|
|
@value = value
|
|
end
|
|
def to_s(depth = 0)
|
|
"'#{@value}'"
|
|
end
|
|
end
|
|
class SymbolConstant < StringConstant
|
|
end
|
|
end
|