rustwasm / weedle

A WebIDL Parser
MIT License
43 stars 27 forks source link

Support async iterable declarations #37

Closed MattiasBuelens closed 4 years ago

MattiasBuelens commented 4 years ago

The WebIDL specification has recently been extended with async iterable declarations on interfaces:

interface interface_identifier {
  async iterable<value_type>;
  async iterable<value_type>(/* arguments... */);
  async iterable<key_type, value_type>;
  async iterable<key_type, value_type>(/* arguments... */);
};

Currently, the streams specification is using this in its ReadableStream definition:

[Exposed=(Window,Worker,Worklet)]
interface ReadableStream {
  // ...

  async iterable<any>(optional ReadableStreamIteratorOptions options = {});
};

This PR adds support for parsing such declarations, and adds the current streams WebIDL definitions as a test case.

alexcrichton commented 4 years ago

Thanks! I think though it might be best to not combine the keywords into async iterable, could two keywords be parsed instead?

alexcrichton commented 4 years ago

👍