2014-06-25 14:20:46 +02:00
|
|
|
require_relative '../helper'
|
|
|
|
require 'parslet/convenience'
|
2014-08-21 21:57:20 +02:00
|
|
|
require "yaml"
|
2014-06-25 14:20:46 +02:00
|
|
|
|
2014-06-26 10:34:48 +02:00
|
|
|
module VirtualHelper
|
2014-06-25 14:20:46 +02:00
|
|
|
# need a code generator, for arm
|
|
|
|
def setup
|
2014-06-26 10:34:48 +02:00
|
|
|
# @object_space = Boot::BootSpace.new "Arm"
|
2014-06-25 14:20:46 +02:00
|
|
|
end
|
|
|
|
|
2014-07-30 20:07:48 +02:00
|
|
|
def check
|
2014-07-30 20:43:12 +02:00
|
|
|
machine = Virtual::Machine.boot
|
|
|
|
expressions = machine.compile_main @string_input
|
2014-07-18 10:16:56 +02:00
|
|
|
should = YAML.load(@output.gsub("RETURN_MARKER" , "\n"))
|
2014-08-18 16:16:18 +02:00
|
|
|
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "RETURN_MARKER") + "\n" + Sof::Writer.write(expressions)
|
|
|
|
puts ""
|
|
|
|
puts Sof::Writer.write(expressions)
|
2014-06-25 14:20:46 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|