Problem
A string that has an invalid escape after an interpolation, followed by a }, makes the lexer abort:
"${x}\ }"home parse, home ast, home check and home run on this file all stop with panic: integer overflow at packages/lexer/src/lexer.zig:1125 instead of reaching normal error handling. All 8 crashes a 2.9 million input mutation fuzz run over the lexer and parser found were this bug.
continueInterpolatedString keeps in_interpolation set while it scans the string text after the } that closes an interpolation. When that text ends in an Invalid token (here the escape \ ), the lexer goes on treating the rest of the line as interpolation code with interpolation_brace_depth at 0, and the next } runs interpolation_brace_depth -= 1.
Fix
continueInterpolatedString clears in_interpolation when it starts scanning string text and sets it again only when the text ends at ${. Every early return in that function (invalid escapes, unterminated string) now leaves the lexer out of interpolation mode. Valid interpolations lex as before.
Tests
Two new tests in packages/lexer/tests/lexer_test.zig. lexer: invalid escape after an interpolation ends the interpolation crashes the test runner on main with panic: integer overflow at lexer.zig:1125; with this change it passes and pins the recovery tokens. lexer: adjacent interpolations re-enter interpolation mode covers the ${ branch that now sets the flag again; it passes on main and fails if that assignment is removed.
GitHub Actions does not run on this repo at the moment, so I ran the suites on Linux x86_64 with the pinned Zig 0.17.0-dev.2163, on main (99c4b47) and on this branch. zig build test --summary all: 9150/9161 passed on main, 9152/9163 on this branch; both runs have the same 3 failing tests, 8 skips and 21 failed build steps. The diagnostic snapshot harness gives identical output on both (70 of 95 cases pass on main). All 352 tracked .home and .hm files produce the same token stream before and after the change. With the built home, the file above makes all four commands panic on main; on this branch home ast and home check report the bad string as parse errors and exit 1. The same fuzz harness found no crashes in 1,320,371 inputs with this change.