diff --git a/lib/support/hash_attributes.rb b/lib/support/hash_attributes.rb deleted file mode 100644 index dd1cb301..00000000 --- a/lib/support/hash_attributes.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Make hash attributes to object attributes - -module Support - module HashAttributes - # map any function call to an attribute if possible - def method_missing name , *args , &block - if args.length > 1 or block_given? - puts "NO -#{args.length} BLOCK #{block_given?}" - super - else - sname = name.to_s - if args.length == 1 #must be assignemnt for ir attr= val - if sname.include? "=" - #puts "setting :#{name.chop}:#{args[0]}" - return @attributes[sname.chop.to_sym] = args[0] - else - super - end - else - #puts "getting :#{name}:#{@attributes[name.to_sym]}" - return @attributes[sname.to_sym] - end - end - end - end -end diff --git a/lib/vm/context.rb b/lib/vm/context.rb index f5a483d8..bbfea8a9 100644 --- a/lib/vm/context.rb +++ b/lib/vm/context.rb @@ -1,17 +1,16 @@ -require "support/hash_attributes" + module Vm #currently just holding the object_space in here so we can have global access class Context - # Make hash attributes to object attributes - include Support::HashAttributes def initialize object_space - @attributes = {} - @attributes[:object_space] = object_space + @object_space = object_space + @locals = {} end - attr_reader :attributes - attr_accessor :current_class + attr_reader :attributes ,:object_space + + attr_accessor :current_class , :locals , :function end end