ion out last changes from grammar update

surprisingly painless, considering it was more or less a rewrite
This commit is contained in:
Torsten Ruger
2015-10-09 18:06:00 +03:00
parent 4c17ed2e6e
commit 024e6cb389
8 changed files with 17 additions and 18 deletions

View File

@ -183,8 +183,8 @@ module Interpreter
left = get_register(@instruction.left)
rr = @instruction.right
right = get_register(rr)
case @instruction.operator
when :add
case @instruction.operator.to_s
when "add"
result = left + right
when "/"
result = left / right
@ -195,7 +195,7 @@ module Interpreter
when "=="
result = left == right
else
raise "unimplemented #{@instruction.operator} #{@instruction}"
raise "unimplemented '#{@instruction.operator}' #{@instruction}"
end
puts "#{@instruction} == #{result}"
right = set_register(rr , result)