object Expr.IVisitor <object> .VisitUnaryExpr(Expr.Unary expr) { object right = Evaluate(expr.right); switch (expr.op.type) { case TokenType.BANG: return(!IsTruthy(right)); case TokenType.MINUS: return(-(double)right); } return(null); }
public object VisitUnaryExpr(Expr.Unary expr) { var right = Evaluate(expr.Right); switch (expr.Op.Type) { case BANG: return(!IsTruthy(right)); case MINUS: CheckNumberOperand(expr.Op, right); return(-(double)right); } return(null); }
public object VisitUnary(Expr.Unary expr) { var right = Evaluate(expr.Right); switch (expr.Op.Type) { case TokenType.Bang: return(!IsTruthy(right)); case TokenType.Minus: AssertNumberOperand(expr.Op, right); return(-(double)right); } throw new NotSupportedException(); }
public string VisitUnary(Expr.Unary expr) { return(Parenthesize(expr.Op.Lexeme, expr.Right)); }
public object VisitUnaryExpr(Expr.Unary expr) { Resolve(expr.Right); return(null); }
public Unit VisitUnary(Expr.Unary expr) { Resolve(expr.Right); return(Unit.Default); }
public Void Visit(Expr.Unary expr) { Resolve(expr.Right); return(Void.Instance); }
object Expr.IVisitor <object> .VisitUnaryExpr(Expr.Unary expr) { Resolve(expr.right); return(null); }