Implement multiple patterns with | in if let and while let

This commit is contained in:
Vadim Petrochenkov
2018-02-24 03:12:35 +03:00
parent 063deba92e
commit 8640a51ff8
12 changed files with 231 additions and 128 deletions

View File

@@ -1085,7 +1085,7 @@ pub enum ExprKind {
/// `if let pat = expr { block } else { expr }`
///
/// This is desugared to a `match` expression.
IfLet(P<Pat>, P<Expr>, P<Block>, Option<P<Expr>>),
IfLet(Vec<P<Pat>>, P<Expr>, P<Block>, Option<P<Expr>>),
/// A while loop, with an optional label
///
/// `'label: while expr { block }`
@@ -1095,7 +1095,7 @@ pub enum ExprKind {
/// `'label: while let pat = expr { block }`
///
/// This is desugared to a combination of `loop` and `match` expressions.
WhileLet(P<Pat>, P<Expr>, P<Block>, Option<Label>),
WhileLet(Vec<P<Pat>>, P<Expr>, P<Block>, Option<Label>),
/// A for loop, with an optional label
///
/// `'label: for pat in expr { block }`