diff --git a/schala-lang/language/src/parsing/new.rs b/schala-lang/language/src/parsing/new.rs index 18b9d5a..2882d0d 100644 --- a/schala-lang/language/src/parsing/new.rs +++ b/schala-lang/language/src/parsing/new.rs @@ -17,7 +17,7 @@ peg::parser! { rule __ = quiet!{ whitespace_or_newline() } pub rule program() -> AST = - statements:(statement() ** delimiter() ) { AST { id: Default::default(), statements: statements.into() } } + __ statements:(statement() ** delimiter() ) __ { AST { id: Default::default(), statements: statements.into() } } rule delimiter() = (";" / "\n")+ diff --git a/schala-lang/language/src/parsing/test.rs b/schala-lang/language/src/parsing/test.rs index 6b09364..e505eae 100644 --- a/schala-lang/language/src/parsing/test.rs +++ b/schala-lang/language/src/parsing/test.rs @@ -857,7 +857,7 @@ fn functions_with_different_whitespace() { "#; for item in [a, b, c].iter() { - assert_ast!( + assert_ast2!( item, vec![fn_decl( Signature { @@ -880,7 +880,7 @@ fn functions_with_different_whitespace() { fn functions_with_default_args() { use ExpressionKind::*; - assert_ast!( + assert_ast2!( "fn func(x: Int, y: Int = 4) { }", vec![fn_decl( Signature {