use debug when parsing

This commit is contained in:
Torsten Ruger 2014-05-08 19:31:36 +03:00
parent 9c609ee299
commit eaf097752a

View File

@ -1,5 +1,6 @@
require_relative 'helper' require_relative 'helper'
require "yaml" require "yaml"
require "parslet/convenience"
class TestRunner < MiniTest::Test class TestRunner < MiniTest::Test
# this creates test methods dynamically , one for each file in runners directory # this creates test methods dynamically , one for each file in runners directory
@ -18,10 +19,11 @@ class TestRunner < MiniTest::Test
def execute file def execute file
string = File.read(file) string = File.read(file)
syntax = Parser::Composed.new.parse(string) parser = Parser::Composed.new
syntax = parser.function_definition.parse_with_debug(string)
program = Vm::Program.new "Arm"
main = Parser::Transform.new.apply(syntax) main = Parser::Transform.new.apply(syntax)
program = Vm::Program.new "Arm"
program.main = main.compile( program.context ) program.main = main.compile( program.context )