Semantic Diff

#9165 Keep the location of templates without interpolations through the v0 AST

1 commit

fa0d7d430d18839eeb134cf81ece8eba3a5a15c5..pr-9165

506cb2579 · cknitt + Claude · Nov 01, 2026, 08:57 UTC

Keep the location of templates without interpolations through ast0

Why

On the v0 wire, a template without interpolations was one string constant at its segment's location, which ends before the closing backquote, so the template lost one character of its location after a PPX round trip. The constant now takes the template's location, and the segment's location is derived from it on the way back (#9164).

modifiedAST template after the v0 round trip

let z = `template`
text
Before
After
parsed: expression [1,0+8]..[1,0+18]parsed: expression [1,0+8]..[1,0+18]after the round trip: expression [1,0+8]..[1,0+17]after the round trip: expression [1,0+8]..[1,0+18]