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

Parse extern (a, b) = ...; and scope (a, b) = ...;. #79

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

tgehr
Copy link
Contributor

@tgehr tgehr commented Oct 11, 2024

Quirin talked a bit about ambiguity issues with his primary type DIP today and we noticed that my unpacking parser has some missing cases (there is no ambiguity, but a lot of similar cases are tricky):

extern (a, b) = tuple (1, 2); // parser thinks this is a linkage declaration

void main(){
    scope (a, b) = tuple(1, 2); // parser thinks this is a scope guard
}

This patch fixes both of those parsing issues, by detecting the = after the parentheses. This is not very important for extern, as extern declarations do not support initializers anyway, but parsing it correctly does improve the error message.

@adamdruppe
Copy link
Contributor

sweet thx

@adamdruppe adamdruppe merged commit fb70ba6 into opendlang:master Oct 11, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants