public object visitUnaryExpr(Expr.Unary expr)
        {
            var right = evaluate(expr.right);

            switch ([email protected])
            {
            case BANG:
                return(!isTruthy(right));

            case MINUS:
                checkNumberOperand(expr.@operator, right);
                return(-(double)right);
            }

            return(null);
        }
Beispiel #2
0
 public object visitUnaryExpr(Expr.Unary expr)
 {
     resolve(expr.right);
     return(null);
 }