move the code insertion functionality up to function. makes more sense. block still carries code though

This commit is contained in:
Torsten Ruger
2014-06-10 23:57:56 +03:00
parent e9fc8ac6aa
commit e9519d4f05
15 changed files with 130 additions and 115 deletions

View File

@@ -28,9 +28,9 @@ class TestRunner < MiniTest::Test
# and the last is wrapped as a main
parts.each_with_index do |part,index|
if index == (parts.length - 1)
expr = part.compile( program.context , program.main )
expr = part.compile( program.context )
else
expr = part.compile( program.context , nil )
expr = part.compile( program.context )
raise "should be function definition for now" unless expr.is_a? Vm::Function
end
end