roc
roc copied to clipboard
Improve parser error message when there is a missing comma in record
Note the missing comma in the definition of foo. Put it back in => no Panic
app "panic"
packages { base: "platform" }
imports [base.Task]
provides [ main ] to base
main : Task.Task {} []
main =
foo = {a: 1 b: 2}
foo.a + foo.b |> Str.fromInt |>
Task.putLine
Found by @jxxcarlson, thanks Jim!
No more panic, but the error could be better:
» main =
…
… foo = {a: 1 b: 2}
…
…
… foo.a + foo.b
── RECORD PARSE PROBLEM ────────────────────────────────────────────────────────
I am partway through parsing an record, but I got stuck here:
1│ app "app" provides [replOutput] to "./platform"
2│
3│ replOutput =
4│ main =
5│
6│ foo = {a: 1 b: 2}
^
TODO provide more context.
Still relevant