rustwasm / weedle

A WebIDL Parser
MIT License
43 stars 27 forks source link

WIP: Support WebIDL modules #31

Closed ghost closed 3 years ago

ghost commented 5 years ago

Companion PR to rustwasm/wasm-bindgen#1746; adds support for WebIDL modules.

alexcrichton commented 5 years ago

Looks great to me! I'm mostly just assuming this matches the syntax of the spec itself but I don't see any issues in merging this

ghost commented 5 years ago

@alexcrichton do you have any thoughts on the best way to represent scoped identifiers here?

Right now I am just parsing the qualifying prefix to Vec<&'src str> but it seems like we would need to change that to Vec<String> or at least Vec<Cow<'src, str>> since there is string processing (case manipulation, etc.) that happens during code generation in wasm-bindgen-webidl.

It also seems like we are going to want to intern the identifiers at some point for performance.

alexcrichton commented 5 years ago

I don't have too much of a preference myself, I don't really know a huge amount about WebIDL or modules or such, I just learned enough to get web-sys implemented :)

ghost commented 5 years ago

Just want to give a quick update on this. I've decided to spend some time working on a rewrite targeting nom 5 first since I've found it far less painful to work with than the current macro heavy implementation. I also wanted to take the opportunity to try and simplify the AST.

I wasn't sure how a rewrite would be received so I've been working on that in a separate crate here.

Once it's further along (can parse webidls) I'd be happy to donate the parser crate to this project (and take ownership of maintenance) if y'all think that's a good idea.

alexcrichton commented 5 years ago

Nice!

We're not necessarily wed to any particular WebIDL parser or the way things are, so long as it serves the purposes of web-sys and it builds quickly I think we're all good to go :)

fitzgen commented 5 years ago

I do love the name weedle tho, so whatever we end up using should probably live here ;)

saschanaz commented 3 years ago

https://github.com/heycam/webidl/pull/675 is dropped, so this should probably be closed.

alexcrichton commented 3 years ago

Ah ok!