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
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| token | Complete literal token in the grammar stated above. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| kind | Kind | Required. Text; maximum UTF-16 length 8192. |
| name | Name | Required. Text; maximum UTF-16 length 8192. |
{
"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
Similar or alternative tools
- Parsing: Yaml Block Chomp Indicator
Parse a restricted YAML block-scalar style/indent/chomping indicator token in either allowed modifier order; does not parse indentation, content or a YAML document.
- Yaml Block Scalar Chomping Token
Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.