()
| 167 | } |
| 168 | |
| 169 | private _advance<T extends Token>(): T { |
| 170 | const prev = this._peek; |
| 171 | if (this._index < this.tokens.length - 1) { |
| 172 | // Note: there is always an EOF token at the end |
| 173 | this._index++; |
| 174 | } |
| 175 | this._peek = this.tokens[this._index]; |
| 176 | return prev as T; |
| 177 | } |
| 178 | |
| 179 | private _advanceIf<T extends TokenType>(type: T): (Token & {type: T}) | null { |
| 180 | if (this._peek.type === type) { |
no outgoing calls
no test coverage detected