W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Grammar for Union Types

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Tue, 03 Jan 2012 17:33:10 +0100
Message-ID: <1325608390.3017.229.camel@altostratustier>
To: public-script-coord@w3.org
Hi,

>From my reading of the grammar of the latest editors draft of Web IDL,
it doesn't match what the examples show is supposed to be supported.

For instance, "float or (Date or Event) or (Node or DOMString)?" doesn't
match the "Type" production, since "ParenthesizedUnionType" only appears
in "Type", and not in SingleType.

Also, I think the usage of parenthesis in types changes the nature of
the grammar. In the example below:
        interface Foo {
          (DOMString) or ();
        };
you can't determine that "or" is actually the name of an operation until
you hit the empty parenthesis.

Also, since "any" is not acceptable in an union type, it probably
shouldn't be allowed in the grammar.

Dom
Received on Tuesday, 3 January 2012 16:35:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:05 UTC