diff --git a/schala-lang/language/src/parsing/new.rs b/schala-lang/language/src/parsing/new.rs index c6937fd..9f10244 100644 --- a/schala-lang/language/src/parsing/new.rs +++ b/schala-lang/language/src/parsing/new.rs @@ -34,7 +34,7 @@ peg::parser! { } rule precedence_continuation() -> (&'input str, ExpressionKind) = - op:operator() _ expr:primary() _ { (op, expr) } + op:operator() _ expr:prefix_expr() _ { (op, expr) } rule prefix_expr() -> ExpressionKind = prefix:prefix()? expr:extended_expr() { diff --git a/schala-lang/language/src/parsing/test.rs b/schala-lang/language/src/parsing/test.rs index ca4d03d..166845b 100644 --- a/schala-lang/language/src/parsing/test.rs +++ b/schala-lang/language/src/parsing/test.rs @@ -225,8 +225,7 @@ fn prefix_exps() { assert_expr2!("-0.2", prefixop("-", expr(FloatLiteral(0.2)))); assert_expr2!("!3", prefixop("!", expr(NatLiteral(3)))); assert_expr2!("!t", prefixop("!", expr(Value(qn!(t))))); - //TODO fix - //assert_expr2!("a <- -b", binop("<-", expr(Value(qn!(a))), prefixop("-", expr(Value(qn!(b)))))); + assert_expr2!("a <- -b", binop("<-", expr(Value(qn!(a))), prefixop("-", expr(Value(qn!(b)))))); assert_expr2!("a <--b", binop("<--", expr(Value(qn!(a))), expr(Value(qn!(b))))); }