Skip to main content

Module parse

Module parse 

Source
Expand description

Multi-format IDL parsing: turn YAML, JSON, or TOML source text into an Api.

parse_api_str is the entry point. On failure it returns a ParseError that carries the source text and, where available, a miette span, so the CLI can render a caret-annotated diagnostic at the offending line and column.

Enums§

ParseError
Everything that can go wrong while turning IDL source text into an Api.

Functions§

line_col_to_offset
Convert a 1-indexed (line, col) pair into a 0-indexed byte offset within src. Returns 0 when either coordinate is 0 (i.e., unknown), and clamps to src.len() when the requested location is past the end.
parse_api_str
Parse IDL source text in the given format into an Api.