Fix prefix-expr bug
This commit is contained in:
parent
76b1e9c0dc
commit
4f3ef5c850
@ -34,7 +34,7 @@ peg::parser! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rule precedence_continuation() -> (&'input str, ExpressionKind) =
|
rule precedence_continuation() -> (&'input str, ExpressionKind) =
|
||||||
op:operator() _ expr:primary() _ { (op, expr) }
|
op:operator() _ expr:prefix_expr() _ { (op, expr) }
|
||||||
|
|
||||||
rule prefix_expr() -> ExpressionKind =
|
rule prefix_expr() -> ExpressionKind =
|
||||||
prefix:prefix()? expr:extended_expr() {
|
prefix:prefix()? expr:extended_expr() {
|
||||||
|
@ -225,8 +225,7 @@ fn prefix_exps() {
|
|||||||
assert_expr2!("-0.2", prefixop("-", expr(FloatLiteral(0.2))));
|
assert_expr2!("-0.2", prefixop("-", expr(FloatLiteral(0.2))));
|
||||||
assert_expr2!("!3", prefixop("!", expr(NatLiteral(3))));
|
assert_expr2!("!3", prefixop("!", expr(NatLiteral(3))));
|
||||||
assert_expr2!("!t", prefixop("!", expr(Value(qn!(t)))));
|
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)))));
|
assert_expr2!("a <--b", binop("<--", expr(Value(qn!(a))), expr(Value(qn!(b)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user