wavefnd / wavefnd/Wave

Migrate match arm grammar errors to structured diagnostics

Open
#396 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue needs testing
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

Tracked by #346.

## Why

The match parser still prints errors for malformed `=>`, case qualification, payload separators, arm bodies, and duplicate wildcards. These failures should use the compiler's structured diagnostic path.

## Scope

- Convert the syntax-level failure paths in `front/parser/src/parser/control.rs` for match headers, patterns, arrows, and arm bodies.
- Preserve semantic variant exhaustiveness diagnostics as they are.
- Add negative tests for a missing `=>`, missing case after `::`, malformed payload list, missing arm brace, and duplicate wildcard.
- Do not change match or variant semantics.

## Completion criteria

- [ ] No direct print remains in the match grammar paths covered here.
- [ ] Errors identify the match/pattern context and expected token.
- [ ] Tests assert message and source location.
- [ ] Existing variant frontend tests pass.

Contributor guide

Open the contributing guide

Research direction

Start in front/parser/src/parser/control.rs and trace the match grammar failure paths for headers, patterns, arrows, and arm bodies. Add negative tests for the five listed malformed cases, asserting diagnostic messages and source locations. Done means those paths use structured diagnostics, semantic exhaustiveness diagnostics remain unchanged, and existing variant frontend tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.