public object visitExprUnaryExpr(ExprUnary expr) { object right = evaluate(expr.right); switch (expr.eOperator.type) { case TokenType.MINUS: checkNumberOperand(expr.eOperator, right); return(-(double)right); case TokenType.BANG: return(!isTruthy(right)); default: return(null); } }
public object visitExprUnaryExpr(ExprUnary expr) { resolve(expr.right); return(null); }
public object visitExprUnaryExpr(ExprUnary expr) { return(parenthesize(expr.eOperator.lexeme, expr.right)); }