fixed multiplication with percent

This commit is contained in:
PaddiM8 2020-12-10 09:27:19 +01:00
parent aa2831818b
commit e0384d3653

View File

@ -132,8 +132,12 @@ fn eval_binary_expr(
}; };
if let Expr::Unary(TokenKind::Percent, _) = right_expr { if let Expr::Unary(TokenKind::Percent, _) = right_expr {
if let TokenKind::Star = op {
right *= 0.01;
} else {
right *= left.clone(); right *= left.clone();
} }
}
Ok(( Ok((
match op { match op {