Fix precedence of postfix match
This commit is contained in:
parent
36b6f9b58e
commit
ab821aed0c
@ -1276,7 +1276,8 @@ pub fn precedence(&self) -> ExprPrecedence {
|
|||||||
ExprKind::While(..) => ExprPrecedence::While,
|
ExprKind::While(..) => ExprPrecedence::While,
|
||||||
ExprKind::ForLoop { .. } => ExprPrecedence::ForLoop,
|
ExprKind::ForLoop { .. } => ExprPrecedence::ForLoop,
|
||||||
ExprKind::Loop(..) => ExprPrecedence::Loop,
|
ExprKind::Loop(..) => ExprPrecedence::Loop,
|
||||||
ExprKind::Match(..) => ExprPrecedence::Match,
|
ExprKind::Match(_, _, MatchKind::Prefix) => ExprPrecedence::Match,
|
||||||
|
ExprKind::Match(_, _, MatchKind::Postfix) => ExprPrecedence::PostfixMatch,
|
||||||
ExprKind::Closure(..) => ExprPrecedence::Closure,
|
ExprKind::Closure(..) => ExprPrecedence::Closure,
|
||||||
ExprKind::Block(..) => ExprPrecedence::Block,
|
ExprKind::Block(..) => ExprPrecedence::Block,
|
||||||
ExprKind::TryBlock(..) => ExprPrecedence::TryBlock,
|
ExprKind::TryBlock(..) => ExprPrecedence::TryBlock,
|
||||||
|
@ -281,6 +281,7 @@ pub enum ExprPrecedence {
|
|||||||
ForLoop,
|
ForLoop,
|
||||||
Loop,
|
Loop,
|
||||||
Match,
|
Match,
|
||||||
|
PostfixMatch,
|
||||||
ConstBlock,
|
ConstBlock,
|
||||||
Block,
|
Block,
|
||||||
TryBlock,
|
TryBlock,
|
||||||
@ -334,7 +335,8 @@ pub fn order(self) -> i8 {
|
|||||||
| ExprPrecedence::InlineAsm
|
| ExprPrecedence::InlineAsm
|
||||||
| ExprPrecedence::Mac
|
| ExprPrecedence::Mac
|
||||||
| ExprPrecedence::FormatArgs
|
| ExprPrecedence::FormatArgs
|
||||||
| ExprPrecedence::OffsetOf => PREC_POSTFIX,
|
| ExprPrecedence::OffsetOf
|
||||||
|
| ExprPrecedence::PostfixMatch => PREC_POSTFIX,
|
||||||
|
|
||||||
// Never need parens
|
// Never need parens
|
||||||
ExprPrecedence::Array
|
ExprPrecedence::Array
|
||||||
|
Loading…
Reference in New Issue
Block a user