fold last of the virtual into register

This commit is contained in:
Torsten Ruger
2015-10-22 18:16:29 +03:00
parent f658ecf425
commit dcbd3c7091
67 changed files with 161 additions and 227 deletions

View File

@ -4,10 +4,10 @@ require_relative '../../helper'
module Statements
def check
machine = Virtual.machine
machine = Register.machine
machine.boot unless machine.booted
machine.parse_and_compile @string_input
produced = Virtual.machine.space.get_main.source
produced = Register.machine.space.get_main.source
assert @expect , "No output given"
assert_equal @expect.length , produced.blocks.length , "Block length"
produced.blocks.each_with_index do |b,i|

View File

@ -5,7 +5,7 @@ class TestAssignStatement < MiniTest::Test
include Statements
def setup
Virtual.machine.boot
Register.machine.boot
end
def test_assign_op
@ -77,7 +77,7 @@ HERE
end
def test_assign_arg
Virtual.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
@string_input = <<HERE
class Object
int main(int bar)
@ -109,7 +109,7 @@ HERE
def test_arg_get
# have to define bar externally, just because redefining main. Otherwise that would be automatic
Virtual.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
@string_input = <<HERE
class Object
int main(int bar)