| 251 | } |
| 252 | |
| 253 | private skipUntil(token: string, errorMessage: string): void { |
| 254 | // Opening markup tokens are longer than or equal to their closing tokens here, so |
| 255 | // this skips past the opening token without missing a valid overlapping close. |
| 256 | const endIndex = this.xml.indexOf(token, this.index + token.length); |
| 257 | if (endIndex === -1) throw new Error(errorMessage); |
| 258 | this.index = endIndex + token.length; |
| 259 | } |
| 260 | |
| 261 | private skipWhitespace(): void { |
| 262 | while (this.index < this.xml.length && isXmlWhitespace(this.xml[this.index])) { |