rename variable type to value_type
in preparation for next rename
This commit is contained in:
parent
6d900f384b
commit
3480b97eaa
@ -127,7 +127,7 @@ module Register
|
||||
:Method => {:name => :Word, :source => :Object, :instructions => :Object, :binary => :Object,
|
||||
:arguments => :List , :for_class => :Class, :locals => :List } ,
|
||||
:Value => {},
|
||||
:Variable => {:type => :Class, :name => :Word , :value => :Object}
|
||||
:Variable => {:value_type => :Class, :name => :Word , :value => :Object}
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -49,7 +49,7 @@ module Parfait
|
||||
# but now we are concerned with booting, ie getting a working structure
|
||||
def add_instance_variable name , type
|
||||
raise "Name shouldn't be nil" unless name
|
||||
raise "Type shouldn't be nil" unless type
|
||||
raise "Value Type shouldn't be nil" unless type
|
||||
self.push(name)
|
||||
self.push(type)
|
||||
self.get_length
|
||||
|
@ -3,14 +3,14 @@ module Parfait
|
||||
|
||||
def initialize type , name , value = nil
|
||||
raise "not type #{type}(#{type.class})" unless Register.machine.space.get_class_by_name(type)
|
||||
self.type , self.name , self.value = type , name , value
|
||||
self.value = 0 if self.type == :Integer and value == nil
|
||||
self.value_type , self.name , self.value = type , name , value
|
||||
self.value = 0 if self.value_type == :Integer and value == nil
|
||||
raise "must give name for variable" unless name
|
||||
end
|
||||
attributes [:type , :name, :value]
|
||||
attributes [:value_type , :name, :value]
|
||||
|
||||
def to_s
|
||||
"Variable(#{self.type} ,#{self.name})"
|
||||
"Variable(#{self.value_type} ,#{self.name})"
|
||||
end
|
||||
def inspect
|
||||
to_s
|
||||
|
@ -25,7 +25,7 @@ module Soml
|
||||
end
|
||||
# either an argument, so it's stored in message
|
||||
if( index = @method.has_arg(name))
|
||||
ret = use_reg @method.arguments[index].type
|
||||
ret = use_reg @method.arguments[index].value_type
|
||||
add_code Register.get_slot(statement , :message , Parfait::Message.get_indexed(index), ret )
|
||||
return ret
|
||||
else # or a local so it is in the frame
|
||||
@ -33,7 +33,7 @@ module Soml
|
||||
if(index)
|
||||
frame = use_reg :Frame
|
||||
add_code Register.get_slot(statement , :message , :frame , frame )
|
||||
ret = use_reg @method.locals[index].type
|
||||
ret = use_reg @method.locals[index].value_type
|
||||
add_code Register.get_slot(statement , frame , Parfait::Frame.get_indexed(index), ret )
|
||||
return ret
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user