bundles/org.eclipse.orion.client.webtools/web/csslint/csslint.js
function(index) {
        var total = index,
            tt;
        if (index > 0) {
            //TODO: Store 5 somewhere
            if (index > 5) {
                throw new Error("Too much lookahead.");
            }

            //get all those tokens
            while (total) {
                tt = this.get();
                total--;
            }

            //unget all those tokens
            while (total < index) {
                this.unget();
                total++;
            }
        } else if (index < 0) {

            if (this._lt[this._ltIndex+index]) {
                tt = this._lt[this._ltIndex+index].type;
            } else {
                throw new Error("Too much lookbehind.");
            }

        } else {
            tt = this._token.type;
        }

        return tt;

    }
function(index) {
        var total = index,
            tt;
        if (index > 0) {
            //TODO: Store 5 somewhere
            if (index > 5) {
                throw new Error("Too much lookahead.");
            }

            //get all those tokens
            while (total) {
                tt = this.get();
                total--;
            }

            //unget all those tokens
            while (total < index) {
                this.unget();
                total++;
            }
        } else if (index < 0) {

            if (this._lt[this._ltIndex+index]) {
                tt = this._lt[this._ltIndex+index].type;
            } else {
                throw new Error("Too much lookbehind.");
            }

        } else {
            tt = this._token.type;
        }

        return tt;

    }
function ( index ) { var total = index , tt ; if ( index > 0 ) { //TODO: Store 5 somewhere if ( index > 5 ) { throw new Error ( "Too much lookahead." ) ; } //get all those tokens while ( total ) { tt = this . get ( ) ; total -- ; } //unget all those tokens while ( total < index ) { this . unget ( ) ; total ++ ; } } else if ( index < 0 ) { if ( this . _lt [ this . _ltIndex + index ] ) { tt = this . _lt [ this . _ltIndex + index ] . type ; } else { throw new Error ( "Too much lookbehind." ) ; } } else { tt = this . _token . type ; } return tt ; }
Looks ahead a certain number of tokens and returns the token type at
that position. This will throw an error if you lookahead past the
end of input, past the size of the lookahead buffer, or back past
the first token in the lookahead buffer.
@param {int} The index of the token type to retrieve. 0 for the
current token, 1 for the next, -1 for the previous, etc.
@return {int} The token type of the token in the given position.
@method LA
Looks ahead a certain number of tokens and returns the token type at that position . This will throw an error if you lookahead past the end of input past the size of the lookahead buffer or back past the first token in the lookahead buffer .