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

Can't represent union types in typedefs #38

Closed
timoxley opened this issue Dec 24, 2015 · 1 comment
Closed

Can't represent union types in typedefs #38

timoxley opened this issue Dec 24, 2015 · 1 comment

Comments

@timoxley
Copy link

Currently webidl2 reports "Unterminated operation" when encountering union types in typedefs.

For example, see this from the webgl 1.0 spec idl:

  typedef (ImageData or
           HTMLImageElement or
           HTMLCanvasElement or
           HTMLVideoElement) TexImageSource;

and these from the webgl 2.0 spec idl:

typedef (Uint32Array or sequence<GLuint>) UniformUIVSource;
...
typedef (Float32Array or sequence<GLfloat>) UniformMatrixFVSource;
...
typedef (Int32Array or sequence<GLint>) VertexAttribIVSource;
// etc

But according to the WebIDL grammar this should be valid, as a Typedef contains a Type:

[24]    Typedef → "typedef" ExtendedAttributeList Type identifier ";"

And a Type can be a SingleType or a UnionType:

[57]    Type    → SingleType 
 | UnionType TypeSuffix
...
[59]    UnionType   → "(" UnionMemberType "or" UnionMemberType UnionMemberTypes ")"
@timoxley
Copy link
Author

timoxley commented Aug 1, 2016

💜

marcoscaceres pushed a commit that referenced this issue Aug 12, 2016
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

1 participant