(
env: &mut Environment,
expr: &UnaryExpr,
titles: &[String],
object: &Vec<Box<dyn Value>>,
)
| 318 | } |
| 319 | |
| 320 | fn evaluate_prefix_unary( |
| 321 | env: &mut Environment, |
| 322 | expr: &UnaryExpr, |
| 323 | titles: &[String], |
| 324 | object: &Vec<Box<dyn Value>>, |
| 325 | ) -> Result<Box<dyn Value>, String> { |
| 326 | let rhs = evaluate_expression(env, &expr.right, titles, object)?; |
| 327 | match expr.operator { |
| 328 | PrefixUnaryOperator::Plus => rhs.plus_op(), |
| 329 | PrefixUnaryOperator::Minus => rhs.neg_op(), |
| 330 | PrefixUnaryOperator::Bang => rhs.bang_op(), |
| 331 | PrefixUnaryOperator::Not => rhs.not_op(), |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | fn evaluate_arithmetic( |
| 336 | env: &mut Environment, |
no test coverage detected
searching dependent graphs…