Skip to content

Commit

Permalink
Merge pull request #220 from jneen/refactor.sepBy1
Browse files Browse the repository at this point in the history
remove `chain` from sepBy1 implementation
  • Loading branch information
Brian Mock committed Dec 27, 2017
2 parents 8865bfd + 9f246d1 commit 291345d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/parsimmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,8 @@ function sepBy1(parser, separator) {
assertParser(parser);
assertParser(separator);
var pairs = separator.then(parser).many();
return parser.chain(function(r) {
return pairs.map(function(rs) {
return [r].concat(rs);
});
return seqMap(parser, pairs, function(r, rs) {
return [r].concat(rs);
});
}

Expand Down

0 comments on commit 291345d

Please sign in to comment.