src/parsers.js
function accumulativeParser(condition, str) {
    let accumulations = [];
    let accumulator = "";

    for (let i = 0; i < str.length; ++i) {
        let ch = str[i];

        if (condition(ch)) {
            accumulator += ch;
        } else if (accumulator !== "") {
            accumulations.push(accumulator);
            accumulator = "";
        }
    }

    return accumulations;
}
function accumulativeParser(condition, str) {
    let accumulations = [];
    let accumulator = "";

    for (let i = 0; i < str.length; ++i) {
        let ch = str[i];

        if (condition(ch)) {
            accumulator += ch;
        } else if (accumulator !== "") {
            accumulations.push(accumulator);
            accumulator = "";
        }
    }

    return accumulations;
}
function accumulativeParser ( condition , str ) { let accumulations = [ ] ; let accumulator = "" ; for ( let i = 0 ; i < str . length ; ++ i ) { let ch = str [ i ] ; if ( condition ( ch ) ) { accumulator += ch ; } else if ( accumulator !== "" ) { accumulations . push ( accumulator ) ; accumulator = "" ; } } return accumulations ; }
returns an array of all sequences of characters in a string that fulfill a condition
returns an array of all sequences of characters in a string that fulfill a condition