Expand description
The text syntax: JSON, plus // and /* */ comments, trailing commas
and unquoted keys (the part of JSON5 editors already understand).
parse keeps where every value is (Spans), so a schema error at
entries[2].pages[0].item can point at its line. Typed values stay
strings here — the schema decides what a string means.
Structs§
- Doc
- A parsed document: the value and where each of its parts is.
- LineCol
- A 1-based line and column (in characters).
- Span
- A byte range of the source.
- Spans
- Where each value of a parsed document is: the value’s span, its key’s (map entries), and its children’s, in the same order as the value’s.
- Syntax
Error - A syntax error.
Constants§
- MAX_
DEPTH - Deeper than this is an error, not a stack overflow.
Functions§
- parse
- Parses Yog Data text.
- parse_
value - Parses Yog Data text, without the positions (faster).
- to_
string valueas compact text (typed values in their string forms).- to_
string_ pretty valueas text indented by two spaces, one entry per line.- write_
string sas a JSON string literal.