ast: Add Fold, Folder traits, reorganize visit
parser: fix precedence of `BindOp::Let`
This commit is contained in:
@@ -507,7 +507,7 @@ fn parse_for(p: &mut Parser<'_>, _level: ()) -> PResult<Expr> {
|
||||
fn from_bind(p: &mut Parser<'_>) -> PResult<(BindOp, PPrec, Option<TKind>, Option<Prec>, Option<Prec>)> {
|
||||
let bk = match p.peek()?.kind {
|
||||
// Token Operator Pat prec Body Token Body prec Else prec
|
||||
TKind::Let => (BindOp::Let, PPrec::Tuple, Some(TKind::Eq), Some(Prec::Compare), Some(Prec::Body)),
|
||||
TKind::Let => (BindOp::Let, PPrec::Tuple, Some(TKind::Eq), Some(Prec::Tuple), Some(Prec::Body)),
|
||||
TKind::Const => (BindOp::Const, PPrec::Tuple, Some(TKind::Eq), Some(Prec::Assign), None),
|
||||
TKind::Static => (BindOp::Static, PPrec::Tuple, Some(TKind::Eq), Some(Prec::Assign), None),
|
||||
TKind::Type => (BindOp::Type, PPrec::Tuple, Some(TKind::Eq), Some(Prec::Project), None),
|
||||
|
||||
Reference in New Issue
Block a user