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

Re: Grammar for Union Types

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Wed, 04 Jan 2012 12:59:37 +0100
Message-ID: <1325678377.3017.256.camel@altostratustier>
To: Cameron McCormack <cam@mcc.id.au>
Cc: public-script-coord@w3.org
Le mercredi 04 janvier 2012 à 10:27 +0100, Dominique Hazael-Massieux a
écrit :
> > Type → SingleType
> >          | UnionType
> > 
> > SingleType → NonAnyType TypeSuffix
> >                | "any" TypeSuffixStartingWithArray
> > 
> > NonAnyType → PrimitiveType TypeSuffix
> >                | "DOMString" TypeSuffix
> >                | identifier TypeSuffix
> >                | "sequence" "<" Type ">" Null
> >                | "object" TypeSuffix
> >                | "Date" TypeSuffix
> > 
> > UnionType → "(" UnionMemberType "or" UnionMemberType UnionMemberTypes 
> > ")" TypeSuffix
> > 
> > UnionMemberType → NonAnyType
> >                     | "any" "[" "]" TypeSuffix
> > 
> > UnionMemberTypes → "or" UnionMemberType UnionMemberTypes
> >                      | ε
> > Can you verify this is correct?
> 
> Looks good to me

Actually, looking at it again, it still doesn't allow for nested union
types, since UnionMemberType doesn't reference UnionType. I think adding
| UnionType to UnionMemberType should do.

Dom
Received on Wednesday, 4 January 2012 12:00:27 UTC

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