MCPcopy Create free account
hub / github.com/denoland/std / readAnchorProperty

Method readAnchorProperty

yaml/_loader_state.ts:1459–1484  ·  view source on GitHub ↗
(anchor: string | null)

Source from the content-addressed store, hash-verified

1457 );
1458 }
1459 readAnchorProperty(anchor: string | null): string | void {
1460 let ch = this.#scanner.peek();
1461 if (ch !== AMPERSAND) return;
1462
1463 if (anchor !== null) {
1464 throw this.#createError(
1465 "Cannot read anchor property: duplicate anchor property",
1466 );
1467 }
1468 this.#scanner.next();
1469 ch = this.#scanner.peek();
1470
1471 const position = this.#scanner.position;
1472 while (ch !== 0 && !isWhiteSpaceOrEOL(ch) && !isFlowIndicator(ch)) {
1473 this.#scanner.next();
1474 ch = this.#scanner.peek();
1475 }
1476
1477 if (this.#scanner.position === position) {
1478 throw this.#createError(
1479 "Cannot read anchor property: name of an anchor node must contain at least one character",
1480 );
1481 }
1482
1483 return this.#scanner.source.slice(position, this.#scanner.position);
1484 }
1485 readAlias(): string | void {
1486 if (this.#scanner.peek() !== ASTERISK) return;
1487

Callers 1

composeNodeMethod · 0.95

Calls 6

#createErrorMethod · 0.95
isWhiteSpaceOrEOLFunction · 0.90
isFlowIndicatorFunction · 0.90
peekMethod · 0.45
nextMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected