Skip to content

Commit

Permalink
support repeated option value (protobufjs#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
natiz committed Dec 15, 2019
1 parent 5f2f62b commit 7547197
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,14 @@ function parse(source, root, options) {
skip(":");
if (peek() === "{")
parseOptionValue(parent, name + "." + token);
else if (skip("[", true)) {
let i = 0;
do {
parseOptionValue(parent, name + "." + token + "[" + i + "]");
skip(',', true);
++i;
} while (!skip("]", true));
}
else
setOption(parent, name + "." + token, readValue(true));
}
Expand Down

0 comments on commit 7547197

Please sign in to comment.