update to use new ast
soml was updated to have a typed ast layer to make programatic creation easier this brings LOTS of syntax change with it, that does not really mean anything at all All tests pass again so back to the same
This commit is contained in:
@ -21,10 +21,11 @@ module ExpressionHelper
|
||||
parser = parser.send @root
|
||||
syntax = parser.parse_with_debug(@string_input, reporter: Parslet::ErrorReporter::Deepest.new)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
codes = Soml.ast_to_code parts
|
||||
#puts parts.inspect
|
||||
compiler = Soml::Compiler.new
|
||||
set_main(compiler)
|
||||
produced = compiler.process( parts )
|
||||
produced = compiler.process( codes )
|
||||
assert @output , "No output given"
|
||||
assert_equal produced.class, @output , "Wrong class"
|
||||
produced
|
||||
|
@ -30,7 +30,7 @@ class TestBasic < MiniTest::Test
|
||||
def test_var
|
||||
@string_input = 'int foo '
|
||||
@root = :field_def
|
||||
@output = AST::Node
|
||||
@output = NilClass
|
||||
check
|
||||
end
|
||||
|
||||
|
@ -40,19 +40,6 @@ HERE
|
||||
check
|
||||
end
|
||||
|
||||
def test_class_field_value
|
||||
@string_input = <<HERE
|
||||
class Space
|
||||
field int boo1 = 1
|
||||
int main()
|
||||
return 1
|
||||
end
|
||||
end
|
||||
HERE
|
||||
@expect = [Label, LoadConstant,SetSlot,Label,FunctionReturn]
|
||||
assert_raises{check}
|
||||
end
|
||||
|
||||
def test_class_field
|
||||
@string_input = <<HERE
|
||||
class Space
|
||||
|
Reference in New Issue
Block a user