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