Skip to main content

Module json

Module json 

Source
Expand description

A strict JSON reader into Value, for the files the core reads itself — a DTCG token file and its resolver (ADR 0062). RFC 8259 and nothing more: no comments, no trailing commas. An object keeps its keys in file order (a Value::Map), and a key given twice keeps the last value, as the DTCG resolver’s “last declaration wins” reads it. A number with no fraction or exponent that fits an i64 is an Value::Int; anything else is a Value::Float.

Structs§

JsonError
Where a document stopped being JSON: 1-based line and column, and what was expected there.

Functions§

parse
Reads one JSON document. Whitespace around it is fine; anything else after it is an error.