Skip to content

Improve source diagnostics and reject recursive inline storage - #986

Merged
LunaStev merged 8 commits into
wavefnd:masterfrom
LunaStev:fix/eight-diagnostic-bundles
Oct 22, 2026
Merged

LunaStev merged 8 commits into
wavefnd:masterfrom
LunaStev:fix/eight-diagnostic-bundles

Conversation

@LunaStev

Copy link
Copy Markdown
Member

Wave currently loses specific parser failures, sometimes highlights a previous argument or the next declaration, and emits plain text for some AST input failures even in JSON mode. This change preserves the offending source ranges and local explanations, makes CLI/source diagnostic selection consistent, and rejects infinitely sized by-value struct storage before LLVM entry.

Examples: a malformed var value: = 1; now identifies = as the missing type boundary; input("{} {}", n, 1) identifies 1 rather than n. Invalid placeholders identify their raw source range even after escapes or Unicode text. Pointer-recursive structs remain accepted.

The eight commits contain these bundles:

Bundle Result Issues
1 Preserve fn/let migration help and missing-semicolon boundaries #359, #360, #361
2 Locate invalid storage names/types and explain array initializer lengths #971, #972
3 Propagate FFI header failures and explain export/proto restrictions #973, #974, #975
4 Explain I/O delimiters/counts and locate invalid format placeholders #976, #977
5 Retain import loading/binding provenance and identify unavailable WebAssembly native sockets #978, #979, #451
6 Focus annotation/input errors and reject by-value recursive storage, including generic wrappers #980, #981, #853
7 Retain unclosed-comment openers and escape terminal control characters in human diagnostics #982, #983
8 Honor the final diagnostic format, unify source-read errors and document the JSON contract #984, #985, #404

Existing grammar, explicit typing, accepted formatting, import containment and generic instantiation limits are preserved. JSON source coordinates/string values remain unchanged by human terminal escaping. The socket diagnostic derives known native exports from the selected std, so misspelled/private symbols keep ordinary resolution errors. LLVM remains the default; the Whale dependency lock is unchanged.

Validation

  • 509 unique Rust tests across 60 workspace/all-target suites passed, combining the workspace run with resumed suites and the corrected focused source-location regression. The original expectation checked the variable name; it now checks the intentionally improved type annotation location.
  • Default workspace/all-target and AArch64-only Clippy passed with warnings denied; rustfmt, touched function spacing, std policy and whitespace checks passed.
  • 146 additional probes passed: 120 LLVM O0/O2 negative diagnostics across ten baseline targets, six shared frontend Whale negative cases, and 20 legal pointer-recursive LLVM IR emissions.
  • The README JSON example was parsed and compared against actual CLI output. Existing AST serialization snapshots and imported-input/output preservation regressions passed.

Cross-target IR emission is not native execution on those platforms. Native macOS/Windows/FreeBSD validation will run in canonical CI. No native Whale execution or dependency update is introduced.

Related to #346. Broader formatting features in #929 remain outside this change.

Fixes #359
Fixes #360
Fixes #361
Fixes #971
Fixes #972
Fixes #973
Fixes #974
Fixes #975
Fixes #976
Fixes #977
Fixes #978
Fixes #979
Fixes #451
Fixes #980
Fixes #981
Fixes #853
Fixes #982
Fixes #983
Fixes #984
Fixes #985
Fixes #404

@LunaStev
LunaStev merged commit aef39a5 into wavefnd:master Oct 22, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment