Make parse_seq_to_before_tokens take expected/nonexpected tokens, use in parse_precise_capturing_syntax
This commit is contained in:
parent
59e2c01c22
commit
68bd001c00
8 changed files with 38 additions and 51 deletions
|
@ -4,7 +4,7 @@ use super::pat::{CommaRecoveryMode, Expected, RecoverColon, RecoverComma};
|
|||
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
|
||||
use super::{
|
||||
AttrWrapper, BlockMode, ClosureSpans, ForceCollect, Parser, PathStyle, Restrictions,
|
||||
SemiColonMode, SeqSep, TokenExpectType, TokenType, Trailing, TrailingToken,
|
||||
SemiColonMode, SeqSep, TokenType, Trailing, TrailingToken,
|
||||
};
|
||||
|
||||
use crate::errors;
|
||||
|
@ -2456,9 +2456,9 @@ impl<'a> Parser<'a> {
|
|||
self.expect(&token::BinOp(token::Or))?;
|
||||
let args = self
|
||||
.parse_seq_to_before_tokens(
|
||||
&[&token::BinOp(token::Or), &token::OrOr],
|
||||
&[&token::BinOp(token::Or)],
|
||||
&[&token::OrOr],
|
||||
SeqSep::trailing_allowed(token::Comma),
|
||||
TokenExpectType::NoExpect,
|
||||
|p| p.parse_fn_block_param(),
|
||||
)?
|
||||
.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue