public object VisitUnaryExpr(Expr.Unary expr) { object right = Evaluate(expr.right); switch (expr.oper.Type) { case TokenType.BANG: return(!IsTruthy(right)); case TokenType.MINUS: CheckNumberOperand(expr.oper, right); return(-(float)right); } // Unreachable. return(null); }
public Void VisitUnaryExpr(Expr.Unary expr) { Resolve(expr.right); return(null); }