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