gren-lang / gren-lang/compiler-common

let-in expression end position includes trailing whitespace

Open Beginner friendly
#13 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.