wavefnd / wavefnd/Wave

Test nested block comments and lexer line tracking

Open
#391 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

Wave supports nested `/* ... */` comments and updates line state while skipping comments. This behavior is currently untested in the lexer crate and affects every later diagnostic.

## Scope

- Test line comments, block comments, and nested block comments.
- Verify the line number of the token immediately after single- and multi-line comments.
- Verify whitespace and CRLF handling.
- Add an unterminated block comment case and assert its structured E1002 diagnostic.
- Do not change the comment syntax.

## Likely files

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

## Completion criteria

- [ ] Nested comments of at least two levels are covered.
- [ ] Line tracking after comments and CRLF input is asserted.
- [ ] Unterminated comments retain E1002 and useful help text.
- [ ] `cargo test -p lexer --locked` passes.

Contributor guide

Open the contributing guide

Research direction

Start with front/lexer/src/trivia.rs and inspect the existing lexer integration-test layout. Run cargo test -p lexer --locked before adding coverage for line comments, nested block comments, whitespace, CRLF input, and the token line after each comment. Done means the tests assert nested comments, line tracking, and the structured E1002 diagnostic with useful help text.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.