()
| 1483 | return this.#scanner.source.slice(position, this.#scanner.position); |
| 1484 | } |
| 1485 | readAlias(): string | void { |
| 1486 | if (this.#scanner.peek() !== ASTERISK) return; |
| 1487 | |
| 1488 | this.#scanner.next(); |
| 1489 | let ch = this.#scanner.peek(); |
| 1490 | |
| 1491 | const position = this.#scanner.position; |
| 1492 | |
| 1493 | while (ch !== 0 && !isWhiteSpaceOrEOL(ch) && !isFlowIndicator(ch)) { |
| 1494 | this.#scanner.next(); |
| 1495 | ch = this.#scanner.peek(); |
| 1496 | } |
| 1497 | |
| 1498 | if (this.#scanner.position === position) { |
| 1499 | throw this.#createError( |
| 1500 | "Cannot read alias: alias name must contain at least one character", |
| 1501 | ); |
| 1502 | } |
| 1503 | |
| 1504 | const alias = this.#scanner.source.slice(position, this.#scanner.position); |
| 1505 | if (!this.anchorMap.has(alias)) { |
| 1506 | throw this.#createError( |
| 1507 | `Cannot read alias: unidentified alias "${alias}"`, |
| 1508 | ); |
| 1509 | } |
| 1510 | |
| 1511 | this.skipSeparationSpace(true, -1); |
| 1512 | |
| 1513 | return this.anchorMap.get(alias); |
| 1514 | } |
| 1515 | resolveTag(state: State) { |
| 1516 | switch (state.tag) { |
| 1517 | case null: |
no test coverage detected