In my parser combinator library I'm making (in JavaScript), each combinator is of this form:
function combinator(parser) {
return new Parser(parserState => {
if (parserState.isError) return parserState;
// ...success
return updateParserState(parserState, index, result);
// ...failure
return updateParserError(parserState, errorMsg);
});
}
I was wondering if it would be possible to convert it to the GLL parsing method? And if so, how?