reduced ast match

This commit is contained in:
greg 2018-07-25 03:05:40 -07:00
parent a2b1b0f953
commit bc6d4d19b5

View File

@ -142,9 +142,15 @@ fn reduce_if_expression(discriminator: &Discriminator, body: &IfExpressionBody,
None => vec![], None => vec![],
Some(stmts) => stmts.iter().map(|expr| expr.reduce(symbol_table)).collect(), Some(stmts) => stmts.iter().map(|expr| expr.reduce(symbol_table)).collect(),
}; };
Expr::Conditional { cond, then_clause, else_clause } Expr::Match {
cond,
arms: vec![
(pat.clone(), then_clause),
(Pattern::Ignored, else_clause)
],
}
}, },
_ => panic!(), IfExpressionBody::GuardList(ref _guard_arms) => panic!(),
} }
} }