-
-
Notifications
You must be signed in to change notification settings - Fork 64
Add trivia for enums and typedefs #207
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nits, but looking good.
lib/webidl2.js
Outdated
}; | ||
consume("{") || error("No curly for enum"); | ||
const open = consume("{") || error("No curly for enum"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Curly” might be confusing. Maybe “no opening {
...”
let value_expected = true; | ||
while (true) { | ||
if (consume("}")) { | ||
const close = consume("}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had expected to see “No closing } for enum” somewhere as an error. Is that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently enum X {
throws with Unexpected value in enum, which is weird here. I introduced eof
type in #185, maybe we can do better with it by Unexpected end of file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #208, we may revisit it later.
Exposes
trivia
field for enum values.