(chars: string)
| 586 | } |
| 587 | |
| 588 | private _attemptStr(chars: string): boolean { |
| 589 | const len = chars.length; |
| 590 | if (this._cursor.charsLeft() < len) { |
| 591 | return false; |
| 592 | } |
| 593 | const initialPosition = this._cursor.clone(); |
| 594 | for (let i = 0; i < len; i++) { |
| 595 | if (!this._attemptCharCode(chars.charCodeAt(i))) { |
| 596 | // If attempting to parse the string fails, we want to reset the parser |
| 597 | // to where it was before the attempt |
| 598 | this._cursor = initialPosition; |
| 599 | return false; |
| 600 | } |
| 601 | } |
| 602 | return true; |
| 603 | } |
| 604 | |
| 605 | private _attemptStrCaseInsensitive(chars: string): boolean { |
| 606 | for (let i = 0; i < chars.length; i++) { |
no test coverage detected