Fixed multiplication with percent

This commit is contained in:
bakk 2021-06-01 16:11:43 +02:00
parent e07c5e5339
commit 236d5842b9

View File

@ -143,10 +143,9 @@ fn eval_binary_expr(
let left = eval_expr(context, left_expr, "")?;
let mut right = eval_expr(context, right_expr, "")?;
if let Expr::Unary(TokenKind::Percent, _) = right_expr {
right = right.mul(context, left.clone());
if let TokenKind::Star = op {
right = right.mul(context, KalkNum::from(0.01));
} else {
right = right.mul(context, left.clone());
return Ok(right);
}
}