core.js
function seq(/* patterns... */) {
        var patterns = [].slice.call(arguments, 0);
        var name = '(' + patterns.join(' ') + ')';

        return new Pattern(name, function (str, pos) {
            var i, r, end = pos, res = [];

            for (i = 0; i < patterns.length; i++) {
                r = patterns[i].exec(str, end);
                if (!r) return;
                res.push(r.res);
                end = r.end;
            }

            return { res: res, end: end };
        });
    }
function seq(/* patterns... */) {
        var patterns = [].slice.call(arguments, 0);
        var name = '(' + patterns.join(' ') + ')';

        return new Pattern(name, function (str, pos) {
            var i, r, end = pos, res = [];

            for (i = 0; i < patterns.length; i++) {
                r = patterns[i].exec(str, end);
                if (!r) return;
                res.push(r.res);
                end = r.end;
            }

            return { res: res, end: end };
        });
    }
function seq ( /* patterns... */ ) { var patterns = [ ] . slice . call ( arguments , 0 ) ; var name = '(' + patterns . join ( ' ' ) + ')' ; return new Pattern ( name , function ( str , pos ) { var i , r , end = pos , res = [ ] ; for ( i = 0 ; i < patterns . length ; i ++ ) { r = patterns [ i ] . exec ( str , end ) ; if ( ! r ) return ; res . push ( r . res ) ; end = r . end ; } return { res : res , end : end } ; } ) ; }
parses a sequence of patterns
parses a sequence of patterns