function peek(tok) {
        if (typeof(tok) === 'string') {
            return input.charAt(i) === tok;
        } else {
            return tok.test(current);
        }
    }
function peek(tok) {
        if (typeof(tok) === 'string') {
            return input.charAt(i) === tok;
        } else {
            return tok.test(current);
        }
    }
function peek ( tok ) { if ( typeof ( tok ) === 'string' ) { return input . charAt ( i ) === tok ; } else { return tok . test ( current ) ; } }
Same as $(), but don't change the state of the parser, just return the match.
Same as $ () but don t change the state of the parser just return the match .
Check if the current token is a valid token