Skip to main content

Module text

Module text 

Source
Expand description

parse_text — entry point for text-block consumers.

Accepts a single string holding either YAML or JSON, picks the right parser, deserializes into a ComprehensionSpec, and routes through ComprehensionSpec::into_algebra.

Detection rule: a leading { (after trimming whitespace) is JSON; anything else is YAML. YAML is a strict superset of JSON for the shapes we accept, so YAML can read JSON input fine — but choosing the matching parser surfaces sharper error messages for JSON authors.

Enums§

TextParseError
Errors produced by parse_text.

Functions§

parse_text
Parse a YAML or JSON text block describing a comprehension into the algebra-layer AST.