Open davidflanagan opened 13 years ago
Do you have a test handy? I think it's a problem with the grammar and I think I know how to fix it, but a copy of the IDL you're trying to parse (not just the bits that break) would be helpful. It's probably a problem with the grammar.
When I try to parse this (straight from the HTML5 spec):
interface HTMLPropertiesCollection : HTMLCollection { caller getter PropertyNodeList namedItem(in DOMString name); readonly attribute DOMStringList names; };
I get this:
node.js:114 throw e; // process.nextTick error, or 'error' event on first tick ^ Expected "?", "[]" or [ \r\n ] but "L" found.
If I change DOMStringList to DOMString or StringList it parses. If I change it to "octet" it parses. But if I change it to "octetTest", it doesn't parse. This time, the error is on the "T" (in Test) instead of the L in List.
The parser can't parse the type DOMSringList, or, in general any type name that has one of the primitive WebIDL types as a prefix. So longStringList would also not parse. I don't know if this is a problem with the grammar or the parser generator. But consider this line from node/WebIDLParser.js:
It looks ahead for known type names, but doesn't verify that they are at token boundaries.