Skip to content

Commit

Permalink
Fixed: Add support for reserved keyword in enums (#950, fixes #949)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccdunder authored and dcodeIO committed Nov 27, 2017
1 parent 20a2627 commit 83477ca
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,19 @@ function parse(source, root, options) {

var enm = new Enum(token);
ifBlock(enm, function parseEnum_block(token) {
if (token === "option") {
parseOption(enm, token);
skip(";");
} else
parseEnumValue(enm, token);
switch(token) {
case "option":
parseOption(enm, token);
skip(";");
break;

case "reserved":
readRanges(enm.reserved || (enm.reserved = []), true);
break;

default:
parseEnumValue(enm, token);
}
});
parent.add(enm);
}
Expand Down

0 comments on commit 83477ca

Please sign in to comment.