Override public void caseASTNode(ASTNode node) {
    for (int i = 0; i < node.getNumChild(); ++i) {
      node.getChild(i).analyze(this);
    }
  }

  @Override public void caseFunction(Function f) {
    caseASTNode(f);
    f.getStmts().insertChild(entryPointLogStmt(identifier(f)), 0);
  }

  @Override public void caseScript(Script s) {
    caseASTNode(s);
    s.getStmts().insertChild(entryPointLogStmt(identifier(s)), 0);
  }

  @Override public void caseLambdaExpr(LambdaExpr e) {
    caseASTNode(e);
    AstUtil.replace(e.getBody(),
        new ParameterizedExpr(
            new NameExpr(new Name("mclab_callgraph_log_then_run")),
            new ast.List<Expr>()
               .add(new StringLiteralExpr("enter " + identifier(e, "<lambda>") + "\\n"))
               .add(new LambdaExpr(new ast.List<>(), (Expr) e.getBody().fullCopy()))));
  }

  @Override public void caseParameterizedExpr(ParameterizedExpr e) {
    e.getArgs().analyze(this);
    if (isCall(e)) {
      AstUtil.replace(e, wrapWithTraceCall(e, false /* isVar */));
    } else if (isVar(e)) {
      // Replace any colons with colon string literals; passing literal
      // colons to functions seems to confuse MATLAB.
      NodeFinder.find(ColonExpr.class, e.getArgs()).forEach(
          node -> AstUtil.replace(node, new StringLiteralExpr(":"))
      );
      AstUtil.replace(e, wrapWithTraceCall(e, true /* isVar */));
    }
  }

  @Override public void caseNameExpr(NameExpr e) {
    if (isCall(e)) {
      AstUtil.replace(e, wrapWithTraceCall(
          new ParameterizedExpr(e.fullCopy(), new ast.List<>()), false /* isVar */));
    }
  }
}
USA TODAY Sports examines the five teams that find themselves in the place no one wants to be in late July.
Late July means five-year plans suddenly junked after a bad two weeks, season-long hopes dissipating in a stretch of poor play and an exercise that for Major League Baseball teams provides a challenge in objectivity.
It’s time to assess reality.
This season, with a pair of playoff teams added to a field now swelling to 12, it’s harder than ever to determine if you are loitering in the playoff mix, harboring a potential sleeping October giant or are wallowing in delusions. As the Aug. 2 trade deadline grows ever closer, and at least one franchise-changing superstar dangles on the market, determining whether you’re in, out, or nominally interested is harder than ever.
Is it the big-market franchise whose revenues and fan base demand it compete at all costs, all the time? Or the efficiency-minded, sustainability-seeking club whose leader’s legacy is increasingly defined by one maneuver – the man who traded Mookie Betts?
Why buy: There’s still plenty of firepower. Sure, the AL East race was over even before Steph Curry shushed the entire city of Boston, but the expanded wild card was designed as much for flailing blue bloods as it was penurious upstarts. There’s no denying the Red Sox are buried in a seven-team pack within 3 ½ games of three wild-card spots, but ask yourself which of those clubs can bang with them when they’re healthy and productive.
Why sell: That firepower represents an opportunity for a massive haul, and contractual realities dictate that chief baseball officer Chaim Bloom think hard about hitting the “implode” button. Shortstop Xander Bogaerts can opt out of his deal after the season and hasn’t come close to an extension agreement, with Trevor Story able to slide over and replace him. Slugger J.D. Martinez has an.849 OPS and an expiring contract. And if they really wanted to go nuclear, it’s evident franchise player Rafael Devers is also nowhere near a long-term deal – and with two more stretch drives before he hits free agency, his trade value may never be higher.
What’s next: Strip-mining the club will only further disillusion a fan base already showing signs of softening demand. Yet it’s hard to imagine a 23rd-rated pitching staff finding its footing with Michael Wacha and Rich Hill on the injured list. Eight pre-deadline games against the Guardians, Brewers and Astros should render a verdict.
Reality check: A 12-game stretch against Cleveland and Minnesota that could have defined this mystifying club resulted in a 7-5 stretch, a.500 record and even more shrugs in the city of big shoulders. Bad team in a bad division always makes it harder to determine which way to turn.
Why buy: This team won 93 games last year and a mildly encouraging 13 of 22 in July. You don’t employ a manager who turns 78 in October merely to retool.
Why sell: One-time All-Stars Lucas Giolito (5.12 ERA) and Lance Lynn (6.43) are potholes in a rotation fixing to waste a career year from Dylan Cease, whose 154 strikeouts lead the majors.
What’s next: The glass-half-full angle says the White Sox, just four games out of first place, control their own destiny. The dark pragmatist says they’re bound for.500, will need a couple bounces to hit 84 wins and the Guardians and Twins play just poorly enough to gift them the division.
Reality check: Four seasons in a never-ending tunnel of tanking gloom has given way to an aesthetically pleasing ballclub now toggling above and below.500 and able to stand toe-to-toe with even the nastiest AL East juggernauts.
Why buy: As the timeless 1989 Charm City hit says, why not? Crowds are filtering back to Camden Yards, catcher Adley Rutschman looks every bit the cornerstone the club expected, life is good.
Why sell: GM Mike Elias never stops stockpiling future assets and, despite deploying arguably the game’s best bullpen, the Orioles’ playoff chances remain fairly minimal. Veteran starter Jordan Lyles and beloved slugger Trey Mancini have steadied a developing roster, but could aid the more “global” cause of one day flooding the AL East with enviable depth.
What’s next: Probably a little more pain. The O’s are ahead of schedule and could be a buyer and seller at the deadline, though that won’t ease the sting if the inspirational Mancini is dealt.
Reality check: One hundred seven wins looks like a long time ago. Perhaps Wilmer Flores, LaMonte Wade Jr. and Darin Ruf don’t add up to one Freddie Freeman. Perhaps old guys no longer rule.
Why buy: An incomplete off-season after an epic 2021 run left plenty of room to improve. Juan Soto is available. A fan base less than inspired by last year’s platoon-driven greatness needs a jolt of star power as much as the clubhouse does. Just win, and you only need to beat out one of the Padres, Phillies and Cardinals for a playoff berth.
Why sell: Four consecutive losses to the Dodgers showed just how glaring the gap is between the clubs. Ace Carlos Rodon reached a clause allowing him to opt out at season’s end, which he almost surely will do; he’d generate a significant return on the market as possibly the best pitcher available.
What’s next: It’s Farhan Zaidi, so expect a lot of activity. There’s a good chance Giants fans won’t like the outcome.
Reality check: They’re not as good as the Mets or Braves. The pitching staff seems perpetually short of an arm or three. Sluggers and scribes are feuding. Summer in the city, and cooler heads are not prevailing.
Why buy: It’s the Phillies, and it’s Dave Dombrowski and they begin the day just a game out of playoff position. Tomorrow can always wait.
Why sell: Any hopes of slugging clubs into submission likely faded when Bryce Harper broke his thumb in June; his torn elbow ligament only further compromised a defensively challenged club. If the point is to win your division, well, the Phillies are a combined 6-13 against Atlanta and New York.
What’s next: While the final wild-card spot would break a postseason absence that extends to 2011, it doesn’t even guarantee a home game in Philly. How much more does Dombrowski pour into a depreciating 2022 asset rather than fuel up for a future run with a strong but for now incomplete core?
Previous: Am I the only one struggling to watch these Olympics?
Am I the only one struggling to watch these Olympics?
Stonebwoy and wife Dr Louisa Satekla’s daughter, Catherine J