Skip to content

Main content

Yaml Anchor Alias Prefix Token Tool

Compute yaml anchor alias prefix token from explicit bounded inputs.

Loading tool…

Description

Return kind=anchor or alias and the literal name.

YAML uses context-sensitive indicators for scalar styles, indentation, tags, anchors, and document boundaries. A token may be meaningful only within the surrounding stream and indentation structure. Recognizing one header or marker is distinct from parsing a document or resolving its values.

Return kind=anchor or alias and the literal name.

When to use this tool

Use Yaml Anchor Alias Prefix Token when you need to recognize the supported YAML marker or header token before a broader parsing step.

How to use the tool and how it works

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read kind, name. Use the output convention below.

Match a token beginning with & or * followed by at least one character excluding whitespace, square/curly brackets, and commas. Return kind=anchor or alias and the literal name.1

Input fieldMeaning and unitsAccepted input
tokenComplete literal token in the grammar stated above.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
kindKindRequired. Text; maximum UTF-16 length 8192.
nameNameRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "token": "&defaults"
  },
  "output": {
    "kind": "anchor",
    "name": "defaults"
  }
}

Limitations and assumptions

  • The token grammar is a local subset-style recognizer rather than a full YAML context check. It does not ensure an anchor exists, enforce uniqueness, resolve aliases, or construct a representation graph.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a full YAML parser for stream context, indentation, aliases, tags, scalar content, and document validity. Treat the output as the stated local recognition result.

References

  1. Calculation and input contract: parse/yaml-anchor-alias-prefix-token — tool.io

Similar or alternative tools