Skip to content

Main content

Yaml Block Scalar Chomping Token Tool

Calculate yaml block scalar chomping token from explicit caller-supplied inputs.

Loading tool…

Description

Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.

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 style=literal or folded and chomping=keep for +, strip for -, or clip when absent.

When to use this tool

Use Yaml Block Scalar Chomping 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 style, chomping. Use the output convention below.

Accept | or > with an optional following + or -. Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.1

Input fieldMeaning and unitsAccepted input
tokenComplete literal token in the grammar stated above.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
styleStyleRequired. Text; maximum UTF-16 length 8192.
chompingChompingRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "token": "|-"
  },
  "output": {
    "style": "literal",
    "chomping": "strip"
  }
}

Limitations and assumptions

  • Indentation indicators and trailing comments are not supported by this token grammar. No scalar body is parsed, folded, or chomped; the result only labels the header notation.
  • 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-block-scalar-chomping-token — tool.io

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.

  • Toml Literal String Quote Count

    Identify the one-quote or three-quote opening delimiter of a TOML literal string, including empty literals; this does not parse a complete TOML document.