Skip to content

Migrate match arm grammar errors to structured diagnostics #396

Closed

Description

@LunaStev

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.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Aug 28, 2026
  2. self-assigned this
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions