More work

This commit is contained in:
Greg Shuflin 2021-11-11 20:56:39 -08:00
parent 08a4800175
commit 7bd6072dae
2 changed files with 3 additions and 3 deletions

View File

@ -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")+

View File

@ -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 {