rubyx/lib/vool/statements/basic_values.rb

54 lines
1.2 KiB
Ruby
Raw Normal View History

2017-04-01 20:28:57 +02:00
module Vool
class IntegerStatement < Statement
attr_reader :value
2017-04-01 20:28:57 +02:00
def initialize(value)
@value = value
end
def ct_type
Parfait.object_space.get_class_by_name(:Integer).instance_type
end
2017-04-01 20:28:57 +02:00
end
class FloatStatement < Statement
attr_reader :value
2017-04-01 20:28:57 +02:00
def initialize(value)
@value = value
end
def ct_type
true
end
2017-04-01 20:28:57 +02:00
end
class TrueStatement < Statement
def ct_type
Parfait.object_space.get_class_by_name(:True).instance_type
end
2017-04-01 20:28:57 +02:00
end
class FalseStatement < Statement
def ct_type
Parfait.object_space.get_class_by_name(:False).instance_type
end
2017-04-01 20:28:57 +02:00
end
class NilStatement < Statement
def ct_type
Parfait.object_space.get_class_by_name(:Nil).instance_type
end
2017-04-01 20:28:57 +02:00
end
2017-04-02 11:59:07 +02:00
class SelfStatement < Statement
end
class SuperStatement < Statement
end
2017-04-01 20:28:57 +02:00
class StringStatement < Statement
attr_reader :value
2017-04-01 20:28:57 +02:00
def initialize(value)
@value = value
end
def ct_type
Parfait.object_space.get_class_by_name(:Word).instance_type
end
2017-04-01 20:28:57 +02:00
end
class SymbolStatement < StringStatement
def ct_type
Parfait.object_space.get_class_by_name(:Word).instance_type
end
2017-04-01 20:28:57 +02:00
end
end