update the reader rewrite and reflect name changes

This commit is contained in:
Torsten Ruger
2015-10-09 17:51:14 +03:00
parent 02e9975ad6
commit 4c17ed2e6e
30 changed files with 114 additions and 119 deletions

View File

@ -11,11 +11,11 @@ class Object
end
HERE
expressions = Virtual.machine.boot.parse_and_compile input
if( expressions.first.is_a? Virtual::Self )
expressions.first.type.instance_variable_set :@of_class , nil
statements = Virtual.machine.boot.parse_and_compile input
if( statements.first.is_a? Virtual::Self )
statements.first.type.instance_variable_set :@of_class , nil
end
is = Sof.write(expressions)
is = Sof.write(statements)
#puts is
assert_equal @output , is
end

View File

@ -7,16 +7,16 @@ class CompilerTest < MiniTest::Test
Virtual.machine.boot
end
def check
res = Phisol::Compiler.compile( @expression )
res = Phisol::Compiler.compile( @statement )
assert res.is_a?(Virtual::Slot) , "compiler must compile to slot, not #{res.inspect}"
end
def test_function_expression
@expression = s(:class, :Foo,
def test_function_statement
@statement = s(:class, :Foo,
s(:derives, :Object),
s(:expressions,
s(:statements,
s(:function, :int, s(:name, :foo),
s(:parameters, s(:parameter, :ref, :x)),
s(:expressions, s(:int, 5)))))
s(:statements, s(:int, 5)))))
check
end
end

View File

@ -6,7 +6,7 @@ class HelloTest < MiniTest::Test
machine = Virtual.machine.boot
Parfait::Space.object_space.get_class_by_name(:Integer).remove_instance_method :plus
#TODO remove this hack: write proper aliases
expressions = machine.parse_and_compile @string_input
statements = machine.parse_and_compile @string_input
output_at = "Register::CallImplementation"
#{}"Register::CallImplementation"
machine.run_before output_at