public object visitUnaryExpr(Expr.Unary expr) { object right = evaluate(expr.right); switch ([email protected]) { case TokenType.BANG: return(!isTruthy(right)); case TokenType.MINUS: checkNumberOperand(expr.@operator, right); return(-(double)right); } // Unreachable. return(null); }
public string visitUnaryExpr(Expr.Unary expr) => parenthesize([email protected], expr.right);