feat(diagnostics): source excerpt + caret for column-carrying parse errors (#407 increment 2)#466
Merged
Merged
Conversation
…rrors (#407 increment 2) The two structured parse-error sites (expected-X-got-Y and the #326 one-statement-per-line check) now print a one-line source excerpt with a caret under the offending column, in the script runner, --lint, and the REPL (callers register the unit's raw source around parse; eval/import/ LSP paths stay unchanged — NULL source, no excerpt). Additive by design: the 'Parse error line N:C: ...' message is byte-unchanged, so every substring-matching test and consumer grep keeps working; tab alignment preserved in the caret line; pathological lines truncate at 200 chars. Remaining #407 scope (per-warning spans, runtime-error columns) stays open on the issue. EM24/EM25 pin the excerpt and the caret column. Gates: release 2596/2596, ASan+UBSan detect_leaks=1 2596/2596. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 7, 2026
The mini-libc has fprintf but no fputc — the freestanding symbol gate caught it (stage 2: one non-HAL residue). col <= 200 by the excerpt guards, so a stack pad buffer + single fprintf is exact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First-hour-experience increment of #407: the column-carrying parse errors now underline the offending column.
--lint, and the REPL (callers register the unit's raw source aroundparse(); eval/import/LSP parse paths unchanged — no source registered, no excerpt).Parse error line N:C: ...message line is byte-unchanged, so every substring assertion (EM checks, consumer greps, test_lint E002) keeps working. Tab alignment preserved; >200-char lines truncate.Gates: release 2596/2596, ASan+UBSan
detect_leaks=12596/2596.Part of #407
🤖 Generated with Claude Code