Track the remaining structured parser diagnostic migration
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## Problem
Wave has a structured `ParseDiagnostic` and unified `WaveError` rendering path, but legacy parser routines still print errors directly to stdout and then return `None`. The top-level parser consequently replaces useful local context with generic messages such as "failed to parse function declaration".
This tracking issue replaces the broad diagnostic requests in #114 and #168 with bounded parser tasks.
## Scope
- Return structured syntax diagnostics from legacy parser routines.
- Preserve the token/span that actually caused the failure.
- Keep human and JSON diagnostic output consistent.
- Remove parser-side error printing as individual grammar paths are migrated.
- Add one positive and one negative regression for each migrated path.
## Out of scope
- Changing Wave language semantics.
- Replacing the existing error crate.
- Adding typo recovery that silently changes the parsed program.
## Completion criteria
- [ ] Declaration and function parser failures preserve their local diagnostic.
- [ ] Control-flow and expression parser failures preserve their local diagnostic.
- [ ] Parser failures do not write ad-hoc error lines to stdout.
- [ ] Human and JSON error formats identify the same source location.
- [ ] Existing valid corpus behavior remains unchanged.
Child issues should each cover one grammar family and remain independently reviewable.
Contributor guide
Research direction
Start by locating the legacy parser routines for declaration, function, control-flow, and expression grammar families, then trace how their failures reach the top-level parser and WaveError rendering. Migrate one grammar family at a time, preserving the failing token/span and removing ad-hoc stdout output. Add one positive and one negative regression per path, and verify human/JSON locations plus the valid corpus remain consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100