Report missing statement semicolons at the closing token
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
Tracked by #346.
## Problem
A missing semicolon inside a function is currently collapsed into a generic top-level function error:
```wave
fun main() {
var value: i32 = 1
}
```
The parser has enough local context to report the missing `;`, but that detail is printed ad hoc and discarded.
## Scope
- Return a structured syntax diagnostic when a declaration or expression statement requires a semicolon.
- Point at the token that ends the incomplete statement, normally `}` or EOF.
- Include `;` in the expected-token list.
- Cover explicit and inferred `var` declarations.
- Add a valid statement control case.
## Completion criteria
- [ ] The message mentions the missing semicolon rather than the whole function declaration.
- [ ] The source location is the incomplete statement boundary.
- [ ] Human and JSON output agree.
- [ ] The parser writes no duplicate error line to stdout.
Contributor guide
Research direction
Start in the parser by reproducing the missing-semicolon example in the issue and trace how the local diagnostic is converted into the generic function error. Verify the declaration and expression-statement cases, explicit and inferred var forms, a valid control case, and both human and JSON output; done means the boundary token and expected `;` are reported once without stdout duplication.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100