wavefnd / wavefnd/Wave

Add maximal-munch regression tests for Wave operators

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

Description

## Why

`front/lexer/src/scan.rs` recognizes many overlapping operators such as `+`/`++`/`+=`, `?`/`??`/`?:`, and `:`/`::`. There are currently no lexer unit tests protecting the longest-token rule.

## Scope

- Add a table-driven lexer test for every single- and multi-character operator.
- Include adjacent operator sequences and an EOF immediately after an operator.
- Assert that multi-character operators are emitted as one token and not split into prefixes.
- Include punctuation used by imports, generic types, arrays, and function return arrows.
- Do not alter precedence or parser semantics.

## Likely files

- `front/lexer/src/scan.rs`
- `front/lexer/src/token.rs`
- A new lexer integration test

## Completion criteria

- [ ] All operator variants are covered.
- [ ] Ambiguous-prefix cases are explicit regressions.
- [ ] Token lexemes and line numbers are asserted.
- [ ] `cargo test -p lexer --locked` passes.

Contributor guide

Open the contributing guide

Research direction

Read front/lexer/src/scan.rs and front/lexer/src/token.rs to map the operator tokens, then inspect the existing lexer tests or add the proposed integration test. Run cargo test -p lexer --locked; done means every operator variant, adjacent sequence, EOF case, ambiguous prefix, lexeme, and line number is asserted without changing parser semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.