Implement RFC 1925
This commit is contained in:
parent
ed532c0d93
commit
f866152991
7 changed files with 81 additions and 2 deletions
|
@ -3155,6 +3155,12 @@ impl<'a> Parser<'a> {
|
|||
maybe_whole!(self, NtArm, |x| x);
|
||||
|
||||
let attrs = self.parse_outer_attributes()?;
|
||||
// Allow a '|' before the pats (RFC 1925)
|
||||
let beginning_vert = if self.eat(&token::BinOp(token::Or)) {
|
||||
Some(self.prev_span)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let pats = self.parse_pats()?;
|
||||
let guard = if self.eat_keyword(keywords::If) {
|
||||
Some(self.parse_expr()?)
|
||||
|
@ -3178,6 +3184,7 @@ impl<'a> Parser<'a> {
|
|||
pats,
|
||||
guard,
|
||||
body: expr,
|
||||
beginning_vert,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue