1
Fork 0

parser: let stmts & for exprs: allow or-patterns.

This commit is contained in:
Mazdak Farrokhzad 2019-08-18 22:54:07 +02:00
parent 92d66a1317
commit 95792b4d5a
24 changed files with 35 additions and 40 deletions

View file

@ -45,12 +45,6 @@ impl<'a> Parser<'a> {
self.parse_pat_with_or(None, gate_or, true)
}
pub(super) fn parse_top_level_pat(&mut self) -> PResult<'a, P<Pat>> {
let pat = self.parse_pat(None)?;
self.maybe_recover_unexpected_comma(pat.span, true)?;
Ok(pat)
}
/// Parses a pattern, that may be a or-pattern (e.g. `Foo | Bar` in `Some(Foo | Bar)`).
/// Corresponds to `pat<allow_top_alt>` in RFC 2535.
fn parse_pat_with_or(