compiler
compiler copied to clipboard
Malformed record modify `{ key | }` creates EXTRA COMMA error
Quick Summary: Malformed record modify { key | } creates EXTRA COMMA error.
SSCCE
$ elm repl
---- Elm 0.19.1 ----------------------------------------------------------------
> { key | }
-- EXTRA COMMA ------------------------------------------------------------ REPL
I am partway through parsing a record, but I got stuck here:
3| { key | }
^
Trailing commas are not allowed in records.
There is no comma, let alone an extra comma. The error message could be improved. (I suspect that allowing { key | } would be contrary to Elm practice.)
- Elm: 0.19
- Browser: None
- Operating System: Not relevant (Linux).
Additional Details
I suspect that {key | puts the compiler into a prev_token = Comma state.
Thanks for reporting this! To set expectations:
- Issues are reviewed in batches, so it can take some time to get a response.
- Ask questions in a community forum. You will get an answer quicker that way!
- If you experience something similar, open a new issue. We like duplicates.
Finally, please be patient with the core team. They are trying their best with limited resources.