()
| 34590 | } |
| 34591 | |
| 34592 | next() { |
| 34593 | const item = this.tokens.next(); |
| 34594 | (0, (_invariant || _load_invariant()).default)(item, 'expected a token'); |
| 34595 | |
| 34596 | const done = item.done, |
| 34597 | value = item.value; |
| 34598 | |
| 34599 | if (done || !value) { |
| 34600 | throw new Error('No more tokens'); |
| 34601 | } else if (value.type === TOKEN_TYPES.comment) { |
| 34602 | this.onComment(value); |
| 34603 | return this.next(); |
| 34604 | } else { |
| 34605 | return this.token = value; |
| 34606 | } |
| 34607 | } |
| 34608 | |
| 34609 | unexpected(msg = 'Unexpected token') { |
| 34610 | throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); |
no test coverage detected