Allow unsuffixed statements in parser

Moves the "STATEMENT AFTER EXPRESSION" error from the parser to canonicalization.
We'll later use this to allow this case in effectful functions.
This commit is contained in:
Agus Zubiaga 2024-10-14 20:05:33 -03:00
parent f677592f97
commit 2cce5ad023
No known key found for this signature in database
23 changed files with 280 additions and 107 deletions

View file

@ -4322,21 +4322,15 @@ mod test_reporting {
"
),
@r###"
STATEMENT AFTER EXPRESSION in tmp/double_equals_in_def/Test.roc
STATEMENT AFTER EXPRESSION in /code/proj/Main.roc
I just finished parsing an expression with a series of definitions,
and this line is indented as if it's intended to be part of that
expression:
1 app "test" provides [main] to "./platform"
2
3 main =
4 x = 3
5 y =
6 x == 5
7 Num.add 1 2
^
^^^^^^
However, I already saw the final expression in that series of
definitions.