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:

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.

✨ Search Document