mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
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:
parent
f677592f97
commit
2cce5ad023
23 changed files with 280 additions and 107 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue