defining constants in melon to match classes in vm

This commit is contained in:
Torsten Ruger 2017-01-17 21:26:28 +02:00
parent 9c83423e50
commit 10d75e136f

View File

@ -6,17 +6,12 @@ module Melon
module MelonTests
include CompilerHelper
include Register::InterpreterHelpers
def setup
Register.machine.boot
end
def check_nil
RubyCompiler.compile @string_input
Register::Collector.collect_space
@interpreter = Register::Interpreter.new
@interpreter.start Register.machine.init
nil
subs = ObjectSpace.each_object(Class).select { |klass| klass < Register::Instruction }
subs.each do |clazz|
name = clazz.to_s
next if name.include?("Arm")
scoped = name.split("::").last
module_eval "#{scoped} = #{name}"
end
end
end