* Expect and consume a keyword at current position.
(keyword: string)
| 590 | * Expect and consume a keyword at current position. |
| 591 | */ |
| 592 | private expectKeyword(keyword: string): void { |
| 593 | for (let i = 0; i < keyword.length; i++) { |
| 594 | const byte = this.scanner.peek(); |
| 595 | |
| 596 | if (byte !== keyword.charCodeAt(i)) { |
| 597 | throw new XRefParseError(`Expected keyword "${keyword}"`); |
| 598 | } |
| 599 | |
| 600 | this.scanner.advance(); |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * Check if current position starts with a keyword (without consuming). |
no test coverage detected