rename left to first in instruction and started on logic instruction cleanup

This commit is contained in:
Torsten Ruger
2014-05-16 10:42:25 +03:00
parent 009c0895f4
commit ef17bbf9dd
11 changed files with 134 additions and 54 deletions

View File

@@ -81,11 +81,11 @@ module Vm
# defaults gets merged into the instructions options hash, ie passed on to the (machine specific)
# Instruction constructor and as such can be used to influence that classes behaviour
def define_instruction(inst , clazz , defaults = {} )
create_method(inst) do |left , options|
create_method(inst) do |first , options|
options = {} if options == nil
options.merge defaults
options[:opcode] = inst
clazz.new(left , options)
clazz.new(first , options)
end
end