Skip to content

fix(tooling): W013 line attribution, W019 discarded interrogatives, phantom LSP input, quiet load_file (#556 #559 #560 #583)#584

Merged
InauguralPhysicist merged 1 commit into
mainfrom
fix/tooling-diagnostics-556-559-560-583
Jul 13, 2026
Merged

fix(tooling): W013 line attribution, W019 discarded interrogatives, phantom LSP input, quiet load_file (#556 #559 #560 #583)#584
InauguralPhysicist merged 1 commit into
mainfrom
fix/tooling-diagnostics-556-559-560-583

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Collaborator

Four consumer-filed tooling/diagnostics quick-wins, one per issue:

#556 — W013 attributed to the shadowing define line

Root cause was in the parser, not the linter: AST_FUNC nodes were stamped with p_cur(p)->line after parse_block consumed the body, i.e. the line of the first statement following the define. Consequences (both halves of the issue): W013 pointed at innocent code, the documented same-line # lint: allow W013 never matched, and consecutive shadowing defines chain-suppressed each other. The node now carries the define token's own line.

Side effect (correctness improvement, one test updated): the trace tape's line record for a define statement now carries the define's line instead of the following statement's, so tests/test_step.sh's scope fixture lands the "inside the frame" state at step 12 instead of 11 — the hardcoded step index and comment updated. The stepper's source echo for that step was previously wrong (| i is 1 shown for the define record).

Regression tests: issue's repro pair (attribution line, same-line pragma) + the chain-suppression case (both of two consecutive shadows warn on their own lines) in tests/test_lint.sh.

#583 — W019: statement-level interrogative discards its result

New rule check_disc_interrog in src/lint.c: any AST_INTERROGATE sitting directly in a statement list (program/if/loop/for/func/try/match/block/unobserved bodies) warns — question-word forms get the issue's suggested message shape ("question words cannot be assigned with is; as a statement its result is discarded"), prev of gets a discarded-result message. Interrogatives inside expressions are structurally unreachable by the check — zero false positives on expression use. Documented as W019 in docs/DIAGNOSTICS.md; scanned every lib/, tests/, examples/ .eigs file — zero hits, nothing to fix. Tests: the issue's Tidepool repro (fires at the right line), prev of statement, and expression-position negatives.

#559 — phantom input LSP completion removed

Removed the one unregistered entry from builtin_docs in src/eigenlsp.c (the real stdin-read primitive lands via #558). Regression test in tests/test_lsp.py: completion must not offer an input label. NOT done: generating the completion list from register_builtins() itself — worth doing but a structural change beyond this sweep; the list is otherwise verified accurate by the suite's LSP checks.

#560load_file silent by default

The unconditional [load_file] Loading ... stderr banner is now gated behind EIGS_VERBOSE_LOAD=1 (issue's preferred option: no other successful builtin announces itself; failures still surface loudly through the error path). docs/DIAGNOSTICS.md informational-messages section updated. Suite section [115b]: successful load emits nothing on stderr; the env var re-enables the banner.

Gates

  • release suite 2849/2849
  • ASan+UBSan suite with detect_leaks=1: tally 0, [87] clean
  • make jit-smoke green
  • make freestanding-check green (builtins.c touched)
  • tools/doc_drift_check.sh rc=0

Closes #556
Closes #559
Closes #560
Closes #583

🤖 Generated with Claude Code

…hantom LSP input, quiet load_file (#556 #559 #560 #583)

- parser: AST_FUNC nodes carry the define token's line, not the line of
  the first statement after the body — W013 now lands on the define,
  same-line allow-pragmas match, consecutive shadows no longer
  chain-suppress (#556). Stepper scope fixture step index updated (the
  define's tape record moved to its own line).
- lint: new W019 — statement-level interrogatives (question words,
  prev of) evaluate-and-discard; warn (#583). DIAGNOSTICS.md row added;
  lib/tests/examples scan clean.
- eigenlsp: remove phantom 'input' completion (#559).
- builtins: load_file banner gated behind EIGS_VERBOSE_LOAD, silent
  default (#560). Suite [115b] pins the quiet default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@InauguralPhysicist InauguralPhysicist merged commit ee307e8 into main Jul 13, 2026
17 checks passed
@InauguralPhysicist InauguralPhysicist deleted the fix/tooling-diagnostics-556-559-560-583 branch July 13, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment