(chars: string)
| 571 | } |
| 572 | |
| 573 | private _attemptStr(chars: string): boolean { |
| 574 | const len = chars.length; |
| 575 | if (this._cursor.charsLeft() < len) { |
| 576 | return false; |
| 577 | } |
| 578 | const initialPosition = this._cursor.clone(); |
| 579 | for (let i = 0; i < len; i++) { |
| 580 | if (!this._attemptCharCode(chars.charCodeAt(i))) { |
| 581 | // If attempting to parse the string fails, we want to reset the parser |
| 582 | // to where it was before the attempt |
| 583 | this._cursor = initialPosition; |
| 584 | return false; |
| 585 | } |
| 586 | } |
| 587 | return true; |
| 588 | } |
| 589 | |
| 590 | private _attemptStrCaseInsensitive(chars: string): boolean { |
| 591 | for (let i = 0; i < chars.length; i++) { |
no test coverage detected