Initial and final newlines are missing from the data in the parser's Context data structure.
Given this input, for example:
1 module Example exposing (..)
2
3 x: Int
4 x = 1
5
6 {- Example 1
7 Second line -}
8
9 {-
10 Example 2
11 Second line -}
12
13 {-
14 Example 3
15 Second Line
16 -}
17
The Comment data for each example is:
Block <Example 1
Second line> @ row=6 col=1
Block <Example 2
Second line> @ row=9 col=1
Block <Example 3
Second Line> @ row=13 col=1
For Example 2, line 9 is the beginning of the comment, but the string "Example 2" actually starts on line 10.
For Example 3, we do not know that terminating "-}" is on a line by itself because the string "Second Line" doesn't have a terminating newline.
To reproduce:
- Clone the repo at https://github.com/gilramir/gren-bug-reports
- cd to the 2026-04-08-multiline-comment directory
- run "./run.sh"
Initial and final newlines are missing from the data in the parser's Context data structure.
Given this input, for example:
The Comment data for each example is:
For Example 2, line 9 is the beginning of the comment, but the string "Example 2" actually starts on line 10.
For Example 3, we do not know that terminating "-}" is on a line by itself because the string "Second Line" doesn't have a terminating newline.
To reproduce: