store three versions of the code in method

source, instructions and binary
This commit is contained in:
Torsten Ruger
2015-10-23 14:41:47 +03:00
parent e0c5bc4c11
commit 897e11ce80
4 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@ module Parfait
raise "No class #{name}" unless clazz
self.for_class = clazz
self.name = name
self.code = BinaryCode.new name
self.binary = BinaryCode.new name
raise "Wrong type, expect List not #{arguments.class}" unless arguments.is_a? List
arguments.each do |var|
raise "Must be variable argument, not #{var}" unless var.is_a? Variable
@ -31,7 +31,7 @@ module Parfait
self.arguments = arguments
self.locals = List.new
end
attributes [:name , :arguments , :for_class , :code , :locals ]
attributes [:name , :source , :instructions , :binary ,:arguments , :for_class, :locals ]
# determine whether this method has an argument by the name