* Consume a token (CSS Syntax §3 "consume a token") — return the next token * and advance the cursor past it. The returned token is valid until the next * `next` re-tokenizes (the reused instance is not cleared by advancing). * @returns {MutableToken} the consumed token
()
| 1969 | * @returns {MutableToken} the consumed token |
| 1970 | */ |
| 1971 | consume() { |
| 1972 | const t = this.next(); |
| 1973 | if (t.type !== TT_EOF) { |
| 1974 | this._pos = t.end; |
| 1975 | this._next = undefined; |
| 1976 | } |
| 1977 | return t; |
| 1978 | } |
| 1979 | |
| 1980 | /** |
| 1981 | * Discard a token (CSS Syntax §3 "discard a token") — advance the cursor past |
no test coverage detected