fix word implementation and tests
much better, though wasteful implementation breaks a few tests, but ploughing on first
This commit is contained in:
@ -71,7 +71,7 @@ module Virtual
|
||||
|
||||
# attr_reader :string
|
||||
def self.compile_string expression , method
|
||||
value = Parfait::Word.new(expression.string)
|
||||
value = Parfait.new_word(expression.string)
|
||||
to = Return.new(Reference , value)
|
||||
Machine.instance.space.add_object value
|
||||
method.add_code Set.new( to , value )
|
||||
|
@ -8,7 +8,7 @@ module Virtual
|
||||
me = Compiler.compile( expession.receiver , method )
|
||||
method.add_code NewMessage.new
|
||||
method.add_code Set.new(NewSelf.new(me.type), me)
|
||||
method.add_code Set.new(NewName.new(), Parfait::Word.new(expession.name))
|
||||
method.add_code Set.new(NewName.new(), Parfait.new_word(expession.name))
|
||||
compiled_args = []
|
||||
expession.args.each_with_index do |arg , i|
|
||||
#compile in the running method, ie before passing control
|
||||
|
@ -26,7 +26,7 @@ module Virtual
|
||||
# compile the false block
|
||||
method.current false_block
|
||||
expression.if_false.each do |part|
|
||||
puts "compiling in if false #{part}"
|
||||
#puts "compiling in if false #{part}"
|
||||
last = Compiler.compile(part,method )
|
||||
raise part.inspect if last.nil?
|
||||
end
|
||||
|
Reference in New Issue
Block a user