parser: use eat_or_separator for leading vert.

This commit is contained in:
Mazdak Farrokhzad
2019-08-18 18:34:35 +02:00
parent dc5bbaf7b2
commit 6498959377
3 changed files with 14 additions and 3 deletions

View File

@@ -22,8 +22,8 @@ impl<'a> Parser<'a> {
/// Parses patterns, separated by '|' s.
pub(super) fn parse_pats(&mut self) -> PResult<'a, Vec<P<Pat>>> {
// Allow a '|' before the pats (RFC 1925 + RFC 2530)
self.eat(&token::BinOp(token::Or));
// Allow a '|' before the pats (RFCs 1925, 2530, and 2535).
self.eat_or_separator();
let mut pats = Vec::new();
loop {