refactor: drop the output-neutral pad on the executed-literal recursion

The call-detection restore splices into a fixed-position list, so its
.ljust(end - start) holds that length invariant and a test guards it. The
DML-scan recursion instead hands the undoubled literal to a fresh scan_region
as its own region, whose length feeds nothing, so the pad only appends
trailing spaces that shift no keyword and change no reported line. Drop it and
the docstring clause that claimed it kept the offsets landing
This commit is contained in:
mateo-berri 2026-08-24 12:54:57 -07:00
parent 422b24023c
commit 15d8f0b43c

View file

@ -633,8 +633,7 @@ def scan_region(
always counted against the whole document, so a statement nested in a dollar-quoted body
reports its real file line and lines up with the markers read from that file. A single-quoted
literal that `DO` or `EXECUTE` runs as SQL is undoubled before it is scanned, so a `--` or `/*`
in one of its nested strings blanks nothing and the statement after it stays visible, and it is
padded back to its span so the offsets still land."""
in one of its nested strings blanks nothing and the statement after it stays visible."""
masked, bodies, literals = mask(region)
executed = executed_names(masked)
runnable = executed_literals(masked, literals, executed)
@ -649,7 +648,7 @@ def scan_region(
if base <= start and end <= commands_end:
yield from scan_region(
document,
undouble(region[start:end]).ljust(end - start),
undouble(region[start:end]),
migration,
markers,
offset + start,