evalLazy method

  1. @override
LazyNumber evalLazy(
  1. LazyNumber v1,
  2. LazyNumber? v2
)
override

Implementation for this operator.

v1 - Operand 1. v2 - Operand 2. Returns the result of the operation.

Implementation

@override
LazyNumber evalLazy(final LazyNumber v1, final LazyNumber? v2) {
  if (v2 != null) {
    throw ExpressionException(
        "Did not expect a second parameter for unary operator");
  }

  return LazyNumberImpl(eval: () {
    return evalUnary(v1.eval());
  }, getString: () {
    return evalUnary(v1.eval()).toString();
  });
}