Open fmease opened 4 years ago
This is very likely still an issue with the new indentation system.
This is very likely still an issue with the new indentation system.
Indeed. Example:
module x ;;; culprit
@hello module y
Output:
error[E010]: found `@`, but expected terminator or keyword `of`
--> /home/fmease/programming/main_projects/lushui/bugs/comment-not-treated-as-line-break.lushui:2:1
|
2 | @hello module y
| ^ unexpected token
|
Relates to #15 in the sense that we should rewrite our trivia (line breaks, whitespace, indentation) system.
Right now, in some cases, there is a difference between three consecutive line breaks and the sequence line break, comment, line break. The parser does not treat them equal in some cases. This is because the lexer merges several true line breaks in a row into one but does not when there is a comment in between. In the parser, I could just start replacing code consuming a "single" line break (according to the lexer) with loops consuming as many as possible. I don't like this.