Squash closures and jumps into a single precedence level
This commit is contained in:
parent
f3ac64ac34
commit
193d82797c
4 changed files with 4 additions and 7 deletions
|
@ -1317,9 +1317,8 @@ impl Expr {
|
|||
|
||||
pub fn precedence(&self) -> ExprPrecedence {
|
||||
match self.kind {
|
||||
ExprKind::Closure(..) => ExprPrecedence::Closure,
|
||||
|
||||
ExprKind::Break(..)
|
||||
| ExprKind::Closure(..)
|
||||
| ExprKind::Continue(..)
|
||||
| ExprKind::Ret(..)
|
||||
| ExprKind::Yield(..)
|
||||
|
|
|
@ -231,8 +231,7 @@ impl AssocOp {
|
|||
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
||||
pub enum ExprPrecedence {
|
||||
Closure,
|
||||
// return, break, yield
|
||||
// return, break, yield, closures
|
||||
Jump,
|
||||
// = += -= *= /= %= &= |= ^= <<= >>=
|
||||
Assign,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue