some renames before main fixes commences
This commit is contained in:
@ -7,7 +7,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( send_method )
|
||||
@compiler = compile_main( send_method )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module VoolBlocks
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@ins = compile_first_block( "local = 5" )
|
||||
@ins = compile_main_block( "local = 5" )
|
||||
end
|
||||
def test_block_compiles
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
@ -30,7 +30,7 @@ module VoolBlocks
|
||||
class TestAssignMomInstanceToLocal < MiniTest::Test
|
||||
include VoolCompile
|
||||
def setup
|
||||
@ins = compile_first_block( "local = @a" , "@a = 5") #second arg in method scope
|
||||
@ins = compile_main_block( "local = @a" , "@a = 5") #second arg in method scope
|
||||
end
|
||||
def test_class_compiles
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
@ -47,7 +47,7 @@ module VoolBlocks
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@ins = compile_first_block( "arg = 5")
|
||||
@ins = compile_main_block( "arg = 5")
|
||||
end
|
||||
|
||||
def test_class_compiles
|
||||
@ -66,12 +66,12 @@ module VoolBlocks
|
||||
def setup
|
||||
end
|
||||
def test_assigns_const
|
||||
@ins = compile_first_block( "@a = 5")
|
||||
@ins = compile_main_block( "@a = 5")
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
assert_equal Mom::IntegerConstant , @ins.right.known_object.class , @ins
|
||||
end
|
||||
def test_assigns_move
|
||||
@ins = compile_first_block( "@a = arg")
|
||||
@ins = compile_main_block( "@a = arg")
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
assert_equal Mom::SlotDefinition , @ins.right.class , @ins
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module VoolBlocks
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@ins = compile_first_block( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
||||
@ins = compile_main_block( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
||||
end
|
||||
|
||||
def test_condition
|
||||
|
@ -5,7 +5,7 @@ module VoolBlocks
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@ins = compile_first_block( "while(@a) ; @a = 5 ; end")
|
||||
@ins = compile_main_block( "while(@a) ; @a = 5 ; end")
|
||||
end
|
||||
|
||||
def test_compiles_as_while
|
||||
|
@ -7,7 +7,7 @@ module Vool
|
||||
include Mom
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( send_method )
|
||||
@compiler = compile_main( send_method )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "5.div8")
|
||||
@compiler = compile_main( "5.div8")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
def test_check_type
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "a = main(1 + 2);return a" )
|
||||
@compiler = compile_main( "a = main(1 + 2);return a" )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "a = 5; a.div4;return ")
|
||||
@compiler = compile_main( "a = 5; a.div4;return ")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
def test_check_type
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "local = 5;return")
|
||||
@compiler = compile_main( "local = 5;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
@ -33,7 +33,7 @@ module Vool
|
||||
class TestAssignMomInstanceToLocal < MiniTest::Test
|
||||
include VoolCompile
|
||||
def setup
|
||||
@compiler = compile_first_method( "@a = 5 ; local = @a;return")
|
||||
@compiler = compile_main( "@a = 5 ; local = @a;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
def test_class_compiles
|
||||
@ -46,7 +46,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "arg = 5;return")
|
||||
@compiler = compile_main( "arg = 5;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
@ -70,13 +70,13 @@ module Vool
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
end
|
||||
def test_assigns_const
|
||||
@compiler = compile_first_method( "@a = 5;return")
|
||||
@compiler = compile_main( "@a = 5;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
assert_equal Mom::IntegerConstant , @ins.right.known_object.class , @ins
|
||||
end
|
||||
def test_assigns_move
|
||||
@compiler = compile_first_method( "@a = arg;return")
|
||||
@compiler = compile_main( "@a = arg;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
assert_equal Mom::SlotLoad , @ins.class , @ins
|
||||
assert_equal Mom::SlotDefinition , @ins.right.class , @ins
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
include ScopeHelper
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_test_main("@a = 5") )
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_main("@a = 5") )
|
||||
@vool = ruby_tree.to_vool
|
||||
end
|
||||
def test_class
|
||||
@ -31,7 +31,7 @@ module Vool
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
end
|
||||
def assert_type_for(input)
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_test_main(input) )
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_main(input) )
|
||||
vool = ruby_tree.to_vool
|
||||
assert_equal ClassExpression , vool.class
|
||||
clazz = vool.create_class_object
|
||||
@ -67,7 +67,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "if(@a) ; @a = 5 ; else; @a = 6 ; end; return")
|
||||
@compiler = compile_main( "if(@a) ; @a = 5 ; else; @a = 6 ; end; return")
|
||||
@ins = @compiler.mom_instructions
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "if(@a) ; @a = 5 ; end;return")
|
||||
@compiler = compile_main( "if(@a) ; @a = 5 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "unless(@a) ; @a = 5 ; end;return")
|
||||
@compiler = compile_main( "unless(@a) ; @a = 5 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "if(@a) ; @a = 5 ; else; @a = 6 ; end;return")
|
||||
@compiler = compile_main( "if(@a) ; @a = 5 ; else; @a = 6 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end;return")
|
||||
@compiler = compile_main( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "@a = 5")
|
||||
@compiler = compile_main( "@a = 5")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "a = 5")
|
||||
@compiler = compile_main( "a = 5")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
@ -37,7 +37,7 @@ module Vool
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = compile_first_method( "arg = 5")
|
||||
@compiler = compile_main( "arg = 5")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -15,7 +15,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "X.plus_equals(arg,1)")
|
||||
@compiler = compile_main( "X.plus_equals(arg,1)")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_test_main("a = 5") )
|
||||
ruby_tree = Ruby::RubyCompiler.compile( as_main("a = 5") )
|
||||
@clazz = ruby_tree.to_vool
|
||||
end
|
||||
def method
|
||||
|
@ -1,11 +1,11 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestReturnMom < MiniTest::Test
|
||||
class TestReturnMom #< MiniTest::Test
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "return 5")
|
||||
@compiler = compile_main( "return 5")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
@ -41,7 +41,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "return 5.div4")
|
||||
@compiler = compile_main( "return 5.div4")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "while(@a) ; @a = 5 ; end;return")
|
||||
@compiler = compile_main( "while(@a) ; @a = 5 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "while(5.div4) ; 5.div4 ; end;return")
|
||||
@compiler = compile_main( "while(5.div4) ; 5.div4 ; end;return")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "return yield(1)" )
|
||||
@compiler = compile_main( "return yield(1)" )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
@ -69,7 +69,7 @@ module Vool
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_first_method( "return yield(some.extra.calls)" )
|
||||
@compiler = compile_main( "return yield(some.extra.calls)" )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
def test_check_label
|
||||
|
Reference in New Issue
Block a user