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

Add support for mixin syntax #112

Closed
tobie opened this issue Nov 3, 2017 · 1 comment
Closed

Add support for mixin syntax #112

tobie opened this issue Nov 3, 2017 · 1 comment

Comments

@tobie
Copy link
Member

tobie commented Nov 3, 2017

Hey,

We recently changed the WebIDL syntax to add support for mixins. We also added CI tooling to make sure the grammar stayed LL(1), and fixed a couple of issues in the process.

Here's an indicative diff of the recent grammar changes, but please do refer to the IDL index section in the spec for details:

--- (old)
+++ (new)
@@ -3,17 +3,13 @@
     ε
 
 Definition ::
-    CallbackOrInterface
+    CallbackOrInterfaceOrMixin
     Namespace
     Partial
     Dictionary
     Enum
     Typedef
-    ImplementsStatement
-
-CallbackOrInterface ::
-    callback CallbackRestOrInterface
-    Interface
+    IncludesStatement
 
 ArgumentNameKeyword ::
     attribute
@@ -23,7 +19,7 @@
     dictionary
     enum
     getter
-    implements
+    includes
     inherit
     interface
     iterable
@@ -38,23 +34,35 @@
     typedef
     unrestricted
 
+CallbackOrInterfaceOrMixin ::
+    callback CallbackRestOrInterface
+    interface InterfaceOrMixin
+
 CallbackRestOrInterface ::
     CallbackRest
-    Interface
+    interface InterfaceRest
+
+InterfaceOrMixin ::
+    InterfaceRest
+    MixinRest
 
-Interface ::
-    interface identifier Inheritance { InterfaceMembers } ;
+InterfaceRest ::
+    identifier Inheritance { InterfaceMembers } ;
 
 Partial ::
     partial PartialDefinition
 
 PartialDefinition ::
-    PartialInterface
+    interface PartialInterfaceOrPartialMixin
     PartialDictionary
     Namespace
 
-PartialInterface ::
-    interface identifier { InterfaceMembers } ;
+PartialInterfaceOrPartialMixin ::
+    PartialInterfaceRest
+    MixinRest
+
+PartialInterfaceRest ::
+    identifier { InterfaceMembers } ;
 
 InterfaceMembers ::
     ExtendedAttributeList InterfaceMember InterfaceMembers
@@ -75,6 +83,22 @@
     : identifier
     ε
 
+MixinRest ::
+    mixin identifier { MixinMembers } ;
+
+MixinMembers ::
+    ExtendedAttributeList MixinMember MixinMembers
+    ε
+
+MixinMember ::
+    Const
+    RegularOperation
+    Stringifier
+    ReadOnly AttributeRest
+
+IncludesStatement ::
+    identifier includes identifier ;
+
 Const ::
     const ConstType identifier = ConstValue ;
 
@@ -130,11 +154,14 @@
     [ ]
 
 Operation ::
-    ReturnType OperationRest
+    RegularOperation
     SpecialOperation
 
+RegularOperation ::
+    ReturnType OperationRest
+
 SpecialOperation ::
-    Special Specials ReturnType OperationRest
+    Special Specials RegularOperation
 
 Specials ::
     Special Specials
@@ -161,8 +188,11 @@
     ε
 
 Argument ::
-    ExtendedAttributeList optional TypeWithExtendedAttributes ArgumentName Default
-    ExtendedAttributeList Type Ellipsis ArgumentName
+    ExtendedAttributeList ArgumentRest
+
+ArgumentRest ::
+    optional TypeWithExtendedAttributes ArgumentName Default
+    Type Ellipsis ArgumentName
 
 ArgumentName ::
     ArgumentNameKeyword
@@ -181,7 +211,7 @@
 
 StringifierRest ::
     ReadOnly AttributeRest
-    ReturnType OperationRest
+    RegularOperation
     ;
 
 StaticMember ::
@@ -189,7 +219,7 @@
 
 StaticMemberRest ::
     ReadOnly AttributeRest
-    ReturnType OperationRest
+    RegularOperation
 
 Iterable ::
     iterable < TypeWithExtendedAttributes OptionalType > ;
@@ -218,7 +248,7 @@
     ε
 
 NamespaceMember ::
-    ReturnType OperationRest
+    RegularOperation
     readonly AttributeRest
 
 Dictionary ::
@@ -229,8 +259,11 @@
     ε
 
 DictionaryMember ::
-    ExtendedAttributeList required TypeWithExtendedAttributes identifier Default ;
-    ExtendedAttributeList Type identifier Default ;
+    ExtendedAttributeList DictionaryMemberRest
+
+DictionaryMemberRest ::
+    required TypeWithExtendedAttributes identifier Default ;
+    Type identifier Default ;
 
 PartialDictionary ::
     dictionary identifier { DictionaryMembers } ;
@@ -259,16 +292,12 @@
 Typedef ::
     typedef TypeWithExtendedAttributes identifier ;
 
-ImplementsStatement ::
-    identifier implements identifier ;
-
 Type ::
     SingleType
     UnionType Null
 
 TypeWithExtendedAttributes ::
-    ExtendedAttributeList SingleType
-    ExtendedAttributeList UnionType Null
+    ExtendedAttributeList Type
 
 SingleType ::
     NonAnyType

Let me know if there's anything I can do to help!


Tracked in: whatwg/webidl#472 | Original pull-request: whatwg/webidl#433

@saschanaz
Copy link
Member

Already done 😄 #105

@tobie tobie mentioned this issue Nov 3, 2017
4 tasks
@tobie tobie closed this as completed Nov 3, 2017
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