MCPcopy
hub / github.com/webpack/webpack / next

Method next

lib/css/syntax.js:1939–1963  ·  view source on GitHub ↗

* The next token (CSS Syntax §3 "next token") — the upcoming token without * consuming it; the `<eof-token>` once the source is exhausted. This is the * token the consume algorithms dispatch on (the spec's "process"). Tokenized * from `_pos` on first use and cached until consumed; comment toke

()

Source from the content-addressed store, hash-verified

1937 * @returns {MutableToken} the next token
1938 */
1939 next() {
1940 if (this._next === undefined) {
1941 const input = this.input;
1942 const tok = this._tok;
1943 let pos = this._pos;
1944 for (;;) {
1945 const t = readToken(input, pos, tok);
1946 if (t === undefined) {
1947 this._next = fill(tok, TT_EOF, input.length, input.length);
1948 break;
1949 }
1950 if (t.type === TT_COMMENT) {
1951 if (t.start >= this._commentHigh) {
1952 if (this._onComment) this._onComment(input, t.start, t.end);
1953 this._commentHigh = t.end;
1954 }
1955 pos = t.end;
1956 continue;
1957 }
1958 this._next = t;
1959 break;
1960 }
1961 }
1962 return /** @type {MutableToken} */ (this._next);
1963 }
1964
1965 /**
1966 * Consume a token (CSS Syntax §3 "consume a token") — return the next token

Callers 15

consumeMethod · 0.95
discardMethod · 0.95
getMethod · 0.45
FileSystemInfo.jsFile · 0.45
[Symbol.iterator]Method · 0.45
_findTargetMethod · 0.45
_getTargetMethod · 0.45
moveTargetMethod · 0.45
getKeyMethod · 0.45
parseAStylesheetFunction · 0.45
parseARuleFunction · 0.45

Calls 2

readTokenFunction · 0.85
fillFunction · 0.85

Tested by

no test coverage detected