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 handle HTML5 type DOMStringList #1

Open
davidflanagan opened this issue Feb 7, 2011 · 2 comments
Open

can't handle HTML5 type DOMStringList #1

davidflanagan opened this issue Feb 7, 2011 · 2 comments

Comments

@davidflanagan
Copy link
Contributor

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:

                if (input.substr(pos, 9) === "DOMString") {
                  var result4 = "DOMString"
                  pos += 9;

It looks ahead for known type names, but doesn't verify that they are at token boundaries.

@darobin
Copy link
Owner

darobin commented Feb 8, 2011

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.

@davidflanagan
Copy link
Contributor Author

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.

@darobin darobin reopened this Jul 18, 2011
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

2 participants