Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
weaver committed Aug 18, 2010
1 parent a60e5d9 commit 5cedc78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ Return an array of one or more values produced by `method`. Each
value is separated by `sep` and the entire sequence is optionally value is separated by `sep` and the entire sequence is optionally
terminated by `sep`. terminated by `sep`.


#### .chainl(method, op, otherwise) #### #### .chainl(method, op, [otherwise]) ####


Parse zero or more values produced by `method` and separated by `op`. This can be used to eliminate direct left-recursion. Parse zero or
Returns a value obtained by left associative application of functions more values produced by `method` and separated by `op`. Returns a
returned by `op`. This can be used to eliminate direct value obtained by left associative application of functions returned
left-recursion. by `op`. If zero values are produced, return otherwise.


#### .chainl1(method, op, otherwise) #### #### .chainl1(method, op) ####


Like `.chainl`, but at least one value must be produced by `method`. Like `.chainl`, but at least one value must be produced by `method`.
For example, this grammar: For example, this grammar:
Expand Down
4 changes: 2 additions & 2 deletions lib/reparse.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -263,6 +263,6 @@ ReParse.prototype.chainl = function(method, op, otherwise, min) {
return (min && (found < min)) ? this.fail(input) : result; return (min && (found < min)) ? this.fail(input) : result;
}; };


ReParse.prototype.chainl1 = function(method, op, otherwise) { ReParse.prototype.chainl1 = function(method, op) {
return this.chainl(method, op, otherwise, 1); return this.chainl(method, op, undefined, 1);
}; };

0 comments on commit 5cedc78

Please sign in to comment.