Skip to content

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

Merged
merged 3 commits into from
Jun 14, 2018
Merged

Add trivia for enums and typedefs #207

merged 3 commits into from
Jun 14, 2018

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
};
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.

2 participants