Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse empty constructor expressions #152

Closed
jfecher opened this issue Feb 1, 2022 · 3 comments
Closed

Cannot parse empty constructor expressions #152

jfecher opened this issue Feb 1, 2022 · 3 comments

Comments

@jfecher
Copy link
Contributor

jfecher commented Feb 1, 2022

Constructor expressions like MyStruct { field1: 3, field2: 5, ... } currently must be non-empty to avoid parsing conflicts when parsing an expression followed by an empty block. For example, in both if a {} and for i in 0..a {} we would otherwise end up being over-eager when parsing the expression, resulting in us parsing Constructor(name: a, fields: []) as the expression rather than just a.

It may need to be the case that if we parse an empty constructor expression we also need to check the token after it to make sure it continues the expression or is a terminator that is not{ (such as =, ;, or keywords like let, fn in the case of error recovery of a missing semicolon).

@kevaundray
Copy link
Contributor

@jfecher whats the status on this?

@jfecher
Copy link
Contributor Author

jfecher commented Jan 23, 2023

Still open, I haven't worked on it.

@kevaundray
Copy link
Contributor

Closed by #1916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants