public object VisitLogicalExpr(Logical expr) { object left = Evaluate(expr.Left); if (expr.Operator.Type == TokenType.OR) { if (IsTruthy(left)) { return(left); } } if (expr.Operator.Type == TokenType.AND) { if (!IsTruthy(left)) { return(left); } } return(Evaluate(expr.Right)); }
public object visit_Logical_Expr(Logical expr) { resolve(expr.right); resolve(expr.left); return(null); }
public object VisitLogicalExpr(Logical expr) { Resolve(expr.Left); Resolve(expr.Right); return(null); }
public string VisitLogicalExpr(Logical expr) => $"{expr.Operator.Type}";