strict
The MixOS strict-data format: the grammar of *.conf.mix and *.data.mix
files. A document is a JSON-shaped tree (nil, bool, number, string, list,
map) with bare keys, optional top-level braces, # / -- comments and
trailing commas. It is loaded as data and never executed: anything that
could run (a variable, a call, a command substitution, interpolation, a
semicolon) is refused with a line-numbered error naming the construct.
The crate has no dependency on the Mix language. It provides:
parse/parse_fileto aValuetree;from_str/from_value/from_fileinto a#[derive(Deserialize)]type, andto_string/to_string_pretty/to_valueback out;encode/encode_prettyfor aValue, in text that reads back unchanged;to_json/from_jsonfor consumers that work onserde_json::Value.
Build and test with cargo test -p strict. The grammar tests live in
tests/grammar.rs, the serde bridge in tests/serde_bridge.rs.
The source is libs/strict.