(str: string)
| 808 | |
| 809 | // Consumes the prefix when it is present and returns whether it has been consumed |
| 810 | private consumeOptional(str: string): boolean { |
| 811 | if (this.peekStartsWith(str)) { |
| 812 | this.remaining = this.remaining.substring(str.length); |
| 813 | return true; |
| 814 | } |
| 815 | return false; |
| 816 | } |
| 817 | |
| 818 | private capture(str: string): void { |
| 819 | if (!this.consumeOptional(str)) { |
no test coverage detected