()
| 442 | } |
| 443 | |
| 444 | private scanIdentifier(): Token { |
| 445 | const start: number = this.index; |
| 446 | this.advance(); |
| 447 | while (isIdentifierPart(this.peek)) this.advance(); |
| 448 | const str: string = this.input.substring(start, this.index); |
| 449 | return KEYWORDS.indexOf(str) > -1 |
| 450 | ? newKeywordToken(start, this.index, str) |
| 451 | : newIdentifierToken(start, this.index, str); |
| 452 | } |
| 453 | |
| 454 | /** Scans an ECMAScript private identifier. */ |
| 455 | private scanPrivateIdentifier(): Token { |
no test coverage detected