Hello. I'm working on implementing the parsing of record destructure declarations.
{ name, age, email } = person
Am I missing something or can I assume that in case of an open curly at the beginning of a statement, the only possibility is for it to be a record destructure declaration? Could it in any way be a block?
Yes this is fraught and i am currently addressing this in my open PR. i've been on vacation but plan to finish it up starting tomorrow
https://github.com/roc-lang/roc/issues/7897
I am just experimenting with it. I can drop it if it interferes with what you are doing. But it got me thinking about this
tldr we need to have an untyped node type and be able to parse these ambiguous tokens and be able to recover seamlessly without backtracking or reparsing
You can feel free to look at my PR or propose a different approach. This should have been done already but my vacation ended up being more busy than my normal working days
Speaking of which, my flight is about to take off. I'll check in tomorrow morning!
Thank you. Have a safe flight :airplane_departure:
In the meantime I will publish my proposal as a draft. I don't really like it because it has to look ahead (ugh) but it kinda works
After a bit of tinkering, here it is https://github.com/roc-lang/roc/pull/8061
Last updated: Jul 26 2025 at 12:14 UTC