implement and test field access

This commit is contained in:
Torsten Ruger
2015-11-08 13:39:13 +02:00
parent b443103ea4
commit 502cfa357d
3 changed files with 62 additions and 5 deletions

View File

@ -2,7 +2,7 @@ module Parfait
class Variable < Object
def initialize type , name , value = nil
raise "not type #{type}" unless Register.machine.space.get_class_by_name(type)
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
raise "must give name for variable" unless name