rename object_type to instance_type

for better distinction that it is not every object
but only instances of the class
This commit is contained in:
Torsten Ruger
2016-02-25 12:16:13 -08:00
parent 278d71b56c
commit a8b815117f
11 changed files with 19 additions and 19 deletions

View File

@ -7,10 +7,10 @@ module Soml
for_class = @clazz
raise "no class" unless for_class
index = for_class.object_type.variable_index(name)
index = for_class.instance_type.variable_index(name)
#raise "class field already defined:#{name} for class #{for_class.name}" if index
#puts "Define field #{name} on class #{for_class.name}"
index = for_class.object_type.add_instance_variable( name , type )
index = for_class.instance_type.add_instance_variable( name , type )
# not sure how to run class code yet. later
raise "value #{value}" if value

View File

@ -10,9 +10,9 @@ module Soml
field_name = field_ast.first_from(:name)
index = clazz.object_type.variable_index(field_name)
index = clazz.instance_type.variable_index(field_name)
raise "field access, but no such field:#{field_name} for class #{clazz.name}" unless index
value = use_reg(clazz.object_type.type_at(index))
value = use_reg(clazz.instance_type.type_at(index))
add_code Register.get_slot(statement , receiver , index, value)

View File

@ -1,6 +1,6 @@
class Class < Object
field List instance_methods
field Type object_type
field Type instance_type
field Word name
field Word super_class_name