Renaming Vool exppressions rightly
Class, Method and Lambda (was block) are expressions. Just making things clearer, especially for the blocks (ahem, lambdas) is matters. wip
This commit is contained in:
@ -29,13 +29,13 @@ module Ruby
|
||||
@vool.body.statements.last
|
||||
end
|
||||
def test_class
|
||||
assert_equal Vool::ClassStatement , @vool.class
|
||||
assert_equal Vool::ClassExpression , @vool.class
|
||||
end
|
||||
def test_body
|
||||
assert_equal Vool::Statements , @vool.body.class
|
||||
end
|
||||
def test_getter
|
||||
assert_equal Vool::MethodStatement , getter.class
|
||||
assert_equal Vool::MethodExpression , getter.class
|
||||
end
|
||||
def test_getter_return
|
||||
assert_equal Vool::ReturnStatement , getter.body.class
|
||||
|
@ -18,7 +18,7 @@ module Ruby
|
||||
input = "def self.tryout(arg) ; arg = true ; return arg ; end "
|
||||
@str = compile( input ).to_s
|
||||
assert @str.include?("def self.tryou"), @str
|
||||
assert @str.include?("arg = true"), @str
|
||||
assert @str.include?("arg = true"), @str
|
||||
end
|
||||
end
|
||||
class TestClassMethodStatement2 < MiniTest::Test
|
||||
@ -43,7 +43,7 @@ module Ruby
|
||||
@lst = compile( input ).to_vool
|
||||
end
|
||||
def test_method
|
||||
assert_equal Vool::ClassMethodStatement , @lst.class
|
||||
assert_equal Vool::ClassMethodExpression , @lst.class
|
||||
end
|
||||
def test_method_args
|
||||
assert_equal [:arg1, :arg2] , @lst.args
|
||||
|
@ -9,7 +9,7 @@ module Ruby
|
||||
@vool = compile( input ).to_vool
|
||||
end
|
||||
def test_class
|
||||
assert_equal Vool::ClassStatement , @vool.class
|
||||
assert_equal Vool::ClassExpression , @vool.class
|
||||
end
|
||||
def test_body
|
||||
assert_equal Vool::Statements , @vool.body.class
|
||||
|
@ -12,7 +12,7 @@ module Ruby
|
||||
assert_equal 2 , @vool.body.length , "setter, getter"
|
||||
end
|
||||
def test_setter
|
||||
assert_equal Vool::MethodStatement , setter.class
|
||||
assert_equal Vool::MethodExpression , setter.class
|
||||
end
|
||||
def test_setter_assign
|
||||
assert_equal Vool::Statements , setter.body.class
|
||||
|
@ -11,7 +11,7 @@ module Ruby
|
||||
assert_equal 4 , @vool.body.length , "2 setters, 2 getters"
|
||||
end
|
||||
def test_setter
|
||||
assert_equal Vool::MethodStatement , setter.class
|
||||
assert_equal Vool::MethodExpression , setter.class
|
||||
end
|
||||
def test_setter_assign
|
||||
assert_equal Vool::Statements , setter.body.class
|
||||
|
@ -38,7 +38,7 @@ module Ruby
|
||||
def test_first
|
||||
assert_equal Vool::LocalAssignment , @lst.first.class
|
||||
assert @lst.first.name.to_s.start_with?("implicit_block_")
|
||||
assert_equal Vool::LambdaStatement , @lst.first.value.class
|
||||
assert_equal Vool::LambdaExpression , @lst.first.value.class
|
||||
end
|
||||
def test_last_send
|
||||
assert_equal 2 , @lst.length
|
||||
|
@ -41,7 +41,7 @@ module Ruby
|
||||
assert @lst.first.first.name.to_s.start_with?("implicit_block")
|
||||
end
|
||||
def test_block_assign_right
|
||||
assert_equal Vool::LambdaStatement , @lst.first.first.value.class
|
||||
assert_equal Vool::LambdaExpression , @lst.first.first.value.class
|
||||
end
|
||||
def test_a_assign
|
||||
assert_equal Vool::LocalAssignment , @lst.first.last.class
|
||||
|
@ -55,8 +55,8 @@ module Ruby
|
||||
class TestVariablesVool < MiniTest::Test
|
||||
include RubyTests
|
||||
def test_local_basic
|
||||
lst = compile( "foo = 1 ; foo").to_vool
|
||||
assert_equal Vool::LocalVariable , lst.statements[1].class
|
||||
lst = compile( "foo = 1 ; return foo").to_vool
|
||||
assert_equal Vool::LocalVariable , lst.statements[1].return_value.class
|
||||
end
|
||||
|
||||
def test_instance_basic
|
||||
|
Reference in New Issue
Block a user