Lol grammar is no longer LL(1)

need to fix
This commit is contained in:
greg 2019-06-13 02:17:57 -07:00
parent 40579d80ce
commit 4c688ce8b2
1 changed files with 4 additions and 4 deletions

View File

@ -1228,7 +1228,7 @@ mod parse_tests {
} }
macro_rules! inv { macro_rules! inv {
($expr_type:expr) => { Meta::new(InvocationArgument::Positional(ex!($expr_type))) } ($expr_type:expr) => { Meta::new(InvocationArgument::Positional($expr_type)) }
} }
macro_rules! binexp { macro_rules! binexp {
@ -1363,7 +1363,7 @@ mod parse_tests {
parse_test!("oi()", AST(vec![exst!(Call { f: bx!(ex!(m val!("oi"))), arguments: vec![] })])); parse_test!("oi()", AST(vec![exst!(Call { f: bx!(ex!(m val!("oi"))), arguments: vec![] })]));
parse_test!("oi(a, 2 + 2)", AST(vec![exst!(Call parse_test!("oi(a, 2 + 2)", AST(vec![exst!(Call
{ f: bx!(ex!(m val!("oi"))), { f: bx!(ex!(m val!("oi"))),
arguments: vec![inv!(val!("a")).into(), inv!(binexp!("+", NatLiteral(2), NatLiteral(2))).into()] arguments: vec![inv!(ex!(val!("a"))).into(), inv!(ex!(binexp!("+", NatLiteral(2), NatLiteral(2)))).into()]
})])); })]));
parse_error!("a(b,,c)"); parse_error!("a(b,,c)");
@ -1626,7 +1626,7 @@ fn a(x) {
type_anno: None, type_anno: None,
body: vec![exst!(s "y")] } body: vec![exst!(s "y")] }
)), )),
arguments: vec![inv!(NatLiteral(1)).into()] })])); arguments: vec![inv!(ex!(NatLiteral(1))).into()] })]));
parse_test_wrap_ast! { parse_test_wrap_ast! {
r#"\(x: Int): String { "q" }"#, r#"\(x: Int): String { "q" }"#,
@ -1668,7 +1668,7 @@ fn a(x) {
exst! { exst! {
Call { Call {
f: bx!(ex!(m Call { f: bx!(ex!(m val!("wahoo"))), arguments: vec![] })), f: bx!(ex!(m Call { f: bx!(ex!(m val!("wahoo"))), arguments: vec![] })),
arguments: vec![inv!(NatLiteral(3)).into()], arguments: vec![inv!(ex!(NatLiteral(3))).into()],
} }
} }
]) ])