More work
This commit is contained in:
parent
08a4800175
commit
7bd6072dae
@ -17,7 +17,7 @@ peg::parser! {
|
|||||||
rule __ = quiet!{ whitespace_or_newline() }
|
rule __ = quiet!{ whitespace_or_newline() }
|
||||||
|
|
||||||
pub rule program() -> AST =
|
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")+
|
rule delimiter() = (";" / "\n")+
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ fn functions_with_different_whitespace() {
|
|||||||
"#;
|
"#;
|
||||||
|
|
||||||
for item in [a, b, c].iter() {
|
for item in [a, b, c].iter() {
|
||||||
assert_ast!(
|
assert_ast2!(
|
||||||
item,
|
item,
|
||||||
vec![fn_decl(
|
vec![fn_decl(
|
||||||
Signature {
|
Signature {
|
||||||
@ -880,7 +880,7 @@ fn functions_with_different_whitespace() {
|
|||||||
fn functions_with_default_args() {
|
fn functions_with_default_args() {
|
||||||
use ExpressionKind::*;
|
use ExpressionKind::*;
|
||||||
|
|
||||||
assert_ast!(
|
assert_ast2!(
|
||||||
"fn func(x: Int, y: Int = 4) { }",
|
"fn func(x: Int, y: Int = 4) { }",
|
||||||
vec![fn_decl(
|
vec![fn_decl(
|
||||||
Signature {
|
Signature {
|
||||||
|
Loading…
Reference in New Issue
Block a user