Skip to content

Commit a6bee54

Browse files
author
DigitalCodeCrafter
committed
fixed wrong bind power for + and -
1 parent 6fd6399 commit a6bee54

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/syntax/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ impl<'a, 'd, D: DiagnosticSink> Parser<'a, 'd, D> {
271271
k::True => Operator::nud_op(|_, t| Expr { kind: ExprKind::Literal(Literal::Bool(true)), span: t.span }),
272272
k::False => Operator::nud_op(|_, t| Expr { kind: ExprKind::Literal(Literal::Bool(false)), span: t.span }),
273273

274-
k::Plus => Operator::led_op(4, Self::parse_binary_op),
275-
k::Minus => Operator { lbp: 4, nud: Some(Self::parse_unary_op), led: Some(Self::parse_binary_op) },
274+
k::Plus => Operator::led_op(6, Self::parse_binary_op),
275+
k::Minus => Operator { lbp: 6, nud: Some(Self::parse_unary_op), led: Some(Self::parse_binary_op) },
276276
k::Star => Operator::led_op(8, Self::parse_binary_op),
277277
k::Slash => Operator::led_op(8, Self::parse_binary_op),
278278

0 commit comments

Comments
 (0)