let_chains: Add support for parsing let expressions.

This commit is contained in:
Mazdak Farrokhzad
2019-05-15 16:03:22 +02:00
parent 3fc9642014
commit dff1e379fc
3 changed files with 21 additions and 52 deletions

View File

@@ -260,6 +260,7 @@ pub enum ExprPrecedence {
Box,
AddrOf,
Let,
Unary,
Call,
@@ -277,9 +278,7 @@ pub enum ExprPrecedence {
Path,
Paren,
If,
IfLet,
While,
WhileLet,
ForLoop,
Loop,
Match,
@@ -318,6 +317,8 @@ impl ExprPrecedence {
// Unary, prefix
ExprPrecedence::Box |
ExprPrecedence::AddrOf |
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
ExprPrecedence::Let |
ExprPrecedence::Unary => PREC_PREFIX,
// Unary, postfix
@@ -338,9 +339,7 @@ impl ExprPrecedence {
ExprPrecedence::Path |
ExprPrecedence::Paren |
ExprPrecedence::If |
ExprPrecedence::IfLet |
ExprPrecedence::While |
ExprPrecedence::WhileLet |
ExprPrecedence::ForLoop |
ExprPrecedence::Loop |
ExprPrecedence::Match |