(kind: XmlError["kind"], message: string, at: number)
| 1456 | } |
| 1457 | |
| 1458 | error(kind: XmlError["kind"], message: string, at: number): XmlError { |
| 1459 | if (at > this.counted) { |
| 1460 | // The parser is not used after an error, so `buf` can be replaced |
| 1461 | if (this.pending !== undefined) this.load(this.pending.join(""), this.pendingStart) |
| 1462 | this.count(at - this.base) |
| 1463 | } |
| 1464 | const line = this.line |
| 1465 | const column = at - this.lineStart + 1 |
| 1466 | return new XmlError({ kind, message: `${message} at line ${line}, column ${column}`, line, column }) |
| 1467 | } |
| 1468 | |
| 1469 | // Advances the line count from `counted` to `to`, an index of `buf`. |
| 1470 | // Counting resumes only where parsing stopped, which is never between a CR |
no test coverage detected