You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The new gren-based parser cannot handle block comments in some places #23
As part of "gren format" testing, I created code with comments all over the place.
Some placements of block comments cannot be parsed by the new parser.
% ~/prj/gren-format/gren.sh format --pre-ast Case1.gren
-- FAILED TO PARSE -------------------------------------------------- Case1.gren
17|
18|
19| type alias RejectedTypeVarsAlias k {- c -} v =
^
20| Array { key : k, value : v }
21|
Expected character '('
Expected character '['
Expected character '_'
Expected character '{'
Expected keyword '='
Expected quote
Invalid character in variable name
Not a valid number
17|
18|
19| type alias RejectedTypeVarsAlias k {- c -} v =
^
20| Array { key : k, value : v }
21|
Reserved word used as variable: 'type'
% ~/prj/gren-format/gren.sh format --pre-ast Case6.gren
-- FAILED TO PARSE -------------------------------------------------- Case6.gren
21| rejectedNegWithGap : Int -> Int
22| rejectedNegWithGap x =
23| - {- between unary minus and operand -} x
^
24|
Expected character '('
Expected character '.'
Expected character '['
Expected character '\'
Expected character '_'
Expected character '{'
Expected quote
Invalid character in variable name
Not a valid number
Activity
gilramir commentedon May 24, 2026
I have updated my gren-bug-reports repo; I had 6 cases, but now 4 are passing and only 2 are failing.
Specifically, Case1.gren fails to parse:
https://github.com/gilramir/gren-bug-reports/blob/main/2026-05-21-comment-placement/src/Case1.gren
and case 6:
https://github.com/gilramir/gren-bug-reports/blob/main/2026-05-21-comment-placement/src/Case6.gren
robinheghan commentedon May 25, 2026
Thank you for keeping this up to date
robinheghan commentedon Oct 16, 2026
Case 6 still seems to fail, but is Case 1 fixed on
main? It seems to compile on my endrobinheghan commentedon Oct 16, 2026
On further inspection, case 6 doesn't seem to be related to the multi-line comment.
Fails with the same error, and the problem is that operators used as functions need to be wrapped in parenthesis.
Legal code would be:
Since I cannot reproduce case 1, and case 6 seems to be invalid syntax, I'm closing this issue