still more meta's

This commit is contained in:
greg 2019-09-20 02:05:57 -07:00
parent f5d1c89574
commit cf9ce74394
2 changed files with 5 additions and 5 deletions

View File

@ -300,11 +300,11 @@ pub enum PatternLiteral {
#[derive(Debug, PartialEq, Clone)]
pub struct Enumerator {
pub id: Rc<String>,
pub generator: Meta<Expression>,
pub generator: Expression,
}
#[derive(Debug, PartialEq, Clone)]
pub enum ForBody {
MonadicReturn(Meta<Expression>),
MonadicReturn(Expression),
StatementBlock(Block),
}

View File

@ -601,14 +601,14 @@ fn for_expr() {
parse_test_wrap_ast! {
"for { a <- maybeValue } return 1",
exst!(ForExpression {
enumerators: vec![Enumerator { id: rc!(a), generator: ex!(m val!("maybeValue")) }],
body: bx!(MonadicReturn(Meta::new(ex!(s "1"))))
enumerators: vec![Enumerator { id: rc!(a), generator: ex!(val!("maybeValue")) }],
body: bx!(MonadicReturn(ex!(s "1")))
})
}
parse_test_wrap_ast! {
"for n <- someRange { f(n); }",
exst!(ForExpression { enumerators: vec![Enumerator { id: rc!(n), generator: ex!(m val!("someRange"))}],
exst!(ForExpression { enumerators: vec![Enumerator { id: rc!(n), generator: ex!(val!("someRange"))}],
body: bx!(ForBody::StatementBlock(vec![exst!(s "f(n)")]))
})
}