gren-lang / gren-lang/compiler-common
let-in expression end position includes trailing whitespace
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
The let-in expression parser assumes the let-in-body parse end equals it's located end: https://github.com/gren-lang/compiler-common/blob/1.0.0/src/Compiler/Parse/Expression.gren#L284
This assumption is wrong when e.g. its body is a function call followed by module-level comments on the following lines.
Instead, the body.end should be used as the end position for the whole located let-in expression.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Compiler/Parse/Expression.gren around line 284, where the let-in expression parser determines its end position. Read how the body is parsed and use the body's end position for the enclosing located expression. Done means trailing whitespace or module-level comments after a function-call body no longer extend the let-in expression's end.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100