()
| 156 | } |
| 157 | |
| 158 | private _advance<T extends Token>(): T { |
| 159 | const prev = this._peek; |
| 160 | if (this._index < this.tokens.length - 1) { |
| 161 | // Note: there is always an EOF token at the end |
| 162 | this._index++; |
| 163 | } |
| 164 | this._peek = this.tokens[this._index]; |
| 165 | return prev as T; |
| 166 | } |
| 167 | |
| 168 | private _advanceIf<T extends TokenType>(type: T): (Token & {type: T}) | null { |
| 169 | if (this._peek.type === type) { |
no outgoing calls
no test coverage detected