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

feat: allow adding additional members to production parse methods #745

Merged
merged 18 commits into from
Jun 21, 2023

Conversation

pyoor
Copy link
Contributor

@pyoor pyoor commented Jun 14, 2023

This PR adds the extMembers key to the production parse method's option bag. The extMembers key is used to add additional members that may exist during parsing. This is especially useful for allowing custom productions expand existing productions.

Additionally, this PR adds extensions to the parse method so that users can add additional allowedMembers on a per production basis.

Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

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

Some nits:

lib/webidl2.js Outdated Show resolved Hide resolved
lib/productions/container.js Outdated Show resolved Hide resolved
pyoor and others added 2 commits June 20, 2023 12:01
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
@@ -16,8 +20,9 @@ export class CallbackInterface extends Container {
tokeniser,
new CallbackInterface({ source: tokeniser.source, tokens }),
{
inheritable: !partial,
inheritable: !!inheritable,
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this change separately? We should either change all partial to inheritable everywhere or keep it everywhere, and making that change here sounds like out-of scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't the issue here that callback interface doesn't support partial at all?

Copy link
Member

Choose a reason for hiding this comment

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

Oh hmm, I think we talked about it somewhere but can't find it anywhere, do you remember? I now wonder why we need it at all, neither the spec nor the mozilla-central uses inheritance for callback interfaces, right?

Copy link
Member

Choose a reason for hiding this comment

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

Ah I found it, and I think we should just remove inheritables here.

Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

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

Thanks!

@saschanaz saschanaz merged commit eb68391 into w3c:main Jun 21, 2023
3 checks passed
@pyoor pyoor deleted the allowed-members branch June 23, 2023 13:57
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