-
Notifications
You must be signed in to change notification settings - Fork 66
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 'oneof' in syntax-directed operations #637
base: main
Are you sure you want to change the base?
Conversation
test/errors.js
Outdated
<h1>Static Semantics: Example</h1> | ||
<dl class='header'></dl> | ||
<emu-grammar> | ||
Foo :: one of \`a\` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should read
Foo :: one of \`a\` | |
Foo :: \`a\` |
We should prohibit "one of" with only one alternative.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the test to Foo :: one of `a` `b`
instead. Allowing Foo :: `a`
should probably be done in a separate PR since it requires changing rhsMatches
to compare different kinds of productions. Also disallowing Foo :: one of `a`
should probably be done in the linter in a separate PR.
Note that the current spec does have examples of an SDO being defined on a "one of" production, but they're all in the 'inline' form, rather than the
|
In the source map spec we have the use-case of declaring an SDO over a lexical production (for VLQ decoding).
This PR adds the missing implementation.