You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run a bunch of parsers, checking that they all succeed, without advancing the position.
Something like:
// [Parser e s (m t) a] -> Parser e s (m t) [a]
// or [forall a. Parser e s (m t) a] -> Parser e s (m t) ()
function and(parsers) {
parsers.forEach(checkParser.bind(null, 'and'));
function f(xs, s) {
var values = [];
for (var i = 0; i < parsers.length; i++) {
var r = parsers[i].parse(xs, s);
if ( r.status !== 'success' ) {
return r;
} else {
values.push(r.result.value);
}
}
return good(values, xs, s);
}
return new Parser(f);
}
The text was updated successfully, but these errors were encountered:
// [Parser e s (m t) a] -> Parser e s (m t) [a]
function and(parsers) {
parsers.forEach(checkParser.bind(null, 'and'));
return seq(parsers.map(lookahead));
}
Run a bunch of parsers, checking that they all succeed, without advancing the position.
Something like:
The text was updated successfully, but these errors were encountered: