yamleam/lexer
YAML lexer — line-oriented.
Splits the source into lines, drops blank/comment-only lines, and
tokenizes each remaining line into a Line(indent, line_number, tokens).
The parser consumes the resulting List(Line) using indent comparison.
Constructs that span several source lines become a single token:
- Block scalars (
|,>, with-/+chomping). When the lexer sees an opener at end-of-line position, it reads continuation lines until indent returns to the parent level, then emits aQuotedScalartoken with folding and chomping applied. - Double-quoted strings that continue onto following lines.
Flow indicators ([, ], {, }, ,) are tracked with a flow
depth so they only act as terminators inside flow context. Tabs in
indentation are rejected, and tags (!) return Unsupported.
Values
pub fn tokenize(
source: String,
) -> Result(List(token.Line), error.YamlError)
Tokenize a YAML source string into a list of logical lines.