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
"implements" not recognized? #14
Comments
I remember it being removed about 5-6 months ago I think. They replaced it with I can add parsing of it back, but it might be alright to just do string replacement from |
I just added a commit to add support for parsing it. Though, I'm going to wait to publish the new 0.6.0 version until #11 has been resolved, since it hopefully should be shortly. In the meantime, you can just use the master branch directly as a dependency. Also, your wording seemed to imply there was more than one type of error? |
Thank you! That seems to fix a large portion of the failures. There were a few different errors, but I didn't go too deep into them, this was just that one that stood out. The full list is here: https://gist.github.com/icefoxen/465c4ecac435600feb4a30ba786330fb This is going from the webidl's in the Firefox source code from here: https://archive.mozilla.org/pub/firefox/releases/59.0/SOURCE The program in https://github.com/icefoxen/orbweaver/ downloads and extracts the appropriate files as part of its ...oh, or you can browse them at https://dxr.mozilla.org/mozilla-central/source/dom/webidl , which I THINK is the same version... (edit: Nope, it totally isn't.) |
A lot of the
...and so on. So, it appears you probably implement the WebIDL spec correctly, but you are probably also the only one. 🙄 Not sure what to do about this. |
I haven't yet looked into in detail at the above errors, but I am curious if you have tried using the WebIDLs in servo. I know that at least these will be parsed 100% correctly as I have written tests for them in parse_test.rs (well, at least at some point when I downloaded them and saved them in the tests folder). Unfortunately, the WebIDLs used by Firefox and Chrome sometimes just add arbitrary grammar extensions that don't seem to be specified anywhere. I do recall the I'm not against adding extensions into the grammar, but I also don't want to stray too far from the specification. Maybe a lot of it can be handled directly in the lexer where we can just output the correct tokens (i.e. |
It does not appear that firefox's IDL conforms to the earlier spec either, annoyingly. It might be some weird mutant hybrid and it would surprise me not at all. I haven't even started looking at what Chrome or Edge do, but I expect them to be uniquely terrible in their own ways. I think I will start with the servo spec at least to get rolling, thank you! If the API described is mostly the same that will be enough for a proof of concept. |
I went through all of the errors you listed, they all seem to be one of the following:
Number 6 is similar to the I probably will take the option of just having separate preprocessing functions for different WebIDL "variants" as to avoid polluting the parser with strange workarounds. |
That sounds fairly reasonable; you obviously know more about the topic than I do, who just cracked open the spec for the first time yesterday. I was vaguely considering writing a patch for Firefox, but I think I'm going to have to just leave it for now, since this is still just an experiment. Implementing those transformations as a preprocessor or such seems relatively doable. For |
Hi, I'm trying to use this to make a webidl-to-Rust compiler: https://github.com/icefoxen/orbweaver/
For the Firefox 59 webidl it parses about 2/3 of the files without errors but one of the main errors is that it doesn't appear to recognize the
implements
keyword, like so:Not sure whether or not this is in the WebIDL standard or is some (inevitable) extension, since I can't find it in the grammar, but I also am only just getting started with this.
Thank you!
The text was updated successfully, but these errors were encountered: