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

Fix a grammar error #486

Merged
merged 1 commit into from
Mar 31, 2025
Merged

Conversation

wspringer
Copy link
Contributor

@wspringer wspringer commented Mar 30, 2025

In the existing situation, the package-decl always requires a semicolon at the end, which has some unexpected effects for nested package definitions:

Incorrectly considered valid according to the current grammar:

package foo:bar; {
  …
}

Note the semicolon between the package name and the curly braces.

Incorrectly considered invalid according to the current grammar:

package foo:bar {
  …
}

In order to fix this, this PR lifts the semicolon token out of the package-decl rule, into the wit-file rule.

Copy link
Collaborator

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@alexcrichton alexcrichton merged commit 110eb6e into WebAssembly:main Mar 31, 2025
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