* Check if current position starts with a keyword (without consuming).
(keyword: string)
| 605 | * Check if current position starts with a keyword (without consuming). |
| 606 | */ |
| 607 | private peekKeyword(keyword: string): boolean { |
| 608 | const startPos = this.scanner.position; |
| 609 | |
| 610 | for (let i = 0; i < keyword.length; i++) { |
| 611 | if (this.scanner.peekAt(startPos + i) !== keyword.charCodeAt(i)) { |
| 612 | return false; |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | return true; |
| 617 | } |
| 618 | } |