From db22966de9e37fad58b84d354f1c75a2cea297d6 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 10 May 2014 10:59:36 +0300 Subject: [PATCH] hacking to get list of expressions to work (shudder) --- test/test_runner.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/test_runner.rb b/test/test_runner.rb index 2e1b62d4..99df65e8 100644 --- a/test/test_runner.rb +++ b/test/test_runner.rb @@ -20,12 +20,19 @@ class TestRunner < MiniTest::Test def execute file string = File.read(file) parser = Parser::Composed.new - syntax = parser.parse_with_debug(string) program = Vm::Program.new "Arm" - main = Parser::Transform.new.apply(syntax) - - - program.main = main.compile( program.context ) + parts = string.split "SPLIT" + parts.each_with_index do |part,index| + puts "parsing #{index}=#{part}" + syntax = parser.parse_with_debug(part) + funct = Parser::Transform.new.apply(syntax) + expr = funct.compile( program.context ) + if index = parts.length + program.main = expr + else + raise "should be function definition for now" unless expr.is_a? Function + end + end program.link_at( 0 , program.context ) @@ -38,7 +45,7 @@ class TestRunner < MiniTest::Test writer.set_text assembly.string writer.save(file.gsub(".rb" , ".o")) - puts program.to_yaml +# puts program.to_yaml end end \ No newline at end of file