Renaming Vool exppressions rightly

Class, Method and Lambda (was block) are expressions.
Just making things clearer, especially for the blocks (ahem, lambdas) is matters.
wip
This commit is contained in:
2019-08-19 11:33:12 +03:00
parent ae16551ed0
commit f87526f86f
44 changed files with 162 additions and 92 deletions

View File

@ -1,9 +1,6 @@
module Vool
#Marker class for different constants
class Constant < Expression
#gobble it up
def each(&block)
end
end
# An integer at the vool level
@ -12,17 +9,15 @@ module Vool
def initialize(value)
@value = value
end
def slot_definition(_)
def to_slot(_)
return Mom::SlotDefinition.new(Mom::IntegerConstant.new(@value) , [])
end
def ct_type
Parfait.object_space.get_type_by_class_name(:Integer)
end
def to_s
def to_s(depth = 0)
value.to_s
end
def each(&block)
end
end
# An float at the vool level
class FloatConstant < Constant
@ -33,7 +28,7 @@ module Vool
def ct_type
true
end
def to_s
def to_s(depth = 0)
value.to_s
end
end
@ -42,7 +37,7 @@ module Vool
def ct_type
Parfait.object_space.get_type_by_class_name(:True)
end
def slot_definition(_)
def to_slot(_)
return Mom::SlotDefinition.new(Parfait.object_space.true_object , [])
end
def to_s(depth = 0)
@ -54,7 +49,7 @@ module Vool
def ct_type
Parfait.object_space.get_type_by_class_name(:False)
end
def slot_definition(_)
def to_slot(_)
return Mom::SlotDefinition.new(Parfait.object_space.false_object , [])
end
def to_s(depth = 0)
@ -66,7 +61,7 @@ module Vool
def ct_type
Parfait.object_space.get_type_by_class_name(:Nil)
end
def slot_definition(_)
def to_slot(_)
return Mom::SlotDefinition.new(Parfait.object_space.nil_object , [])
end
def to_s(depth = 0)
@ -80,7 +75,7 @@ module Vool
def initialize(type = nil)
@my_type = type
end
def slot_definition(compiler)
def to_slot(compiler)
@my_type = compiler.receiver_type
Mom::SlotDefinition.new(:message , [:receiver])
end
@ -101,7 +96,7 @@ module Vool
def initialize(value)
@value = value
end
def slot_definition(_)
def to_slot(_)
return Mom::SlotDefinition.new(Mom::StringConstant.new(@value),[])
end
def ct_type