///|
test "parse strict JSON" {
match @json.parse("{\"enabled\":true,\"retries\":3}") {
Ok(Object(members~)) => inspect(members.length(), content="2")
Err(_) => fail("expected JSON object")
_ => fail("expected JSON object")
}
}pub(all) enum JsonError {
Syntax(error~ : ParseError)
DuplicateKey(key~ : String, first_offset~ : Int, duplicate_offset~ : Int)
Limit(kind~ : JsonLimitKind, offset~ : Int, limit~ : Int)
}pub(all) enum JsonLimitKind {
InputChars
NestingDepth
StringChars
ArrayItems
ObjectMembers
}pub struct JsonLimits {
// private fields
}fn JsonLimits::new(max_input_chars~ : Int, max_depth~ : Int, max_string_chars~ : Int, max_array_items~ : Int, max_object_members~ : Int) -> JsonLimitsInstall
Download zipComposable, token-generic parsers for MoonBit.