Skip to content

Conversation

@saschanaz
Copy link
Member

Exposes trivia field for enum values.

Copy link
Member

@marcoscaceres marcoscaceres left a 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
trivia
};
consume("{") || error("No curly for enum");
const open = consume("{") || error("No curly for enum");
Copy link
Member

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("}");
Copy link
Member

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?

Copy link
Member Author

@saschanaz saschanaz Jun 14, 2018

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.

Copy link
Member Author

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.

@saschanaz saschanaz merged commit 9df331c into develop Jun 14, 2018
@saschanaz saschanaz deleted the trivia-enums-typedefs branch June 14, 2018 13:49
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

Successfully merging this pull request may close these issues.

3 participants