named the first intruction constructor argument

This commit is contained in:
Torsten Ruger
2014-05-15 19:41:51 +03:00
parent b4c79d218f
commit a0f0d08e81
13 changed files with 78 additions and 77 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 |options|
create_method(inst) do |left , options|
options = {} if options == nil
options.merge defaults
options[:opcode] = inst
clazz.new(options)
clazz.new(left , options)
end
end