Test alt form

This commit is contained in:
greg 2018-06-19 02:35:01 -07:00
parent 7882e92ab5
commit 005aba7a10
1 changed files with 18 additions and 0 deletions

View File

@ -1141,6 +1141,24 @@ fn a(x) {
)])
};
parse_test! {
"if a() then { b(); c() } else { q }", AST(vec![exprstatement!(
IfExpression {
discriminator: bx! {
Discriminator::Simple(ex!(Call { f: bx!(ex!(val!("a"))), arguments: vec![]}))
},
body: bx! {
IfExpressionBody::SimpleConditional(
vec![exprstatement!(Call { f: bx!(ex!(val!("b"))), arguments: vec![]}), exprstatement!(Call { f: bx!(ex!(val!("c"))), arguments: vec![] })],
Some(
vec![exprstatement!(val!("q"))],
)
)
}
}
)])
};
/*
parse_test!("if a() then { b(); c() }", AST(vec![exprstatement!(
IfExpression(bx!(ex!(Call { f: bx!(ex!(val!("a"))), arguments: vec![]})),