* Read an integer from current scanner position.
()
| 568 | * Read an integer from current scanner position. |
| 569 | */ |
| 570 | private readIntegerFromCurrent(): number | null { |
| 571 | let value = 0; |
| 572 | let hasDigits = false; |
| 573 | |
| 574 | while (true) { |
| 575 | const byte = this.scanner.peek(); |
| 576 | |
| 577 | if (byte >= DIGIT_0 && byte <= DIGIT_9) { |
| 578 | value = value * 10 + (byte - DIGIT_0); |
| 579 | hasDigits = true; |
| 580 | this.scanner.advance(); |
| 581 | } else { |
| 582 | break; |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | return hasDigits ? value : null; |
| 587 | } |
| 588 | |
| 589 | /** |
| 590 | * Expect and consume a keyword at current position. |
no test coverage detected