Strict JSON parsing (#11592)

# Description
Adds the `--strict` flag for `from json` which will try to parse text
while following the exact JSON specification (e.g., no comments or
trailing commas allowed). Fixes issue #11548.
This commit is contained in:
Ian Manske
2024-01-30 14:10:19 +00:00
committed by GitHub
parent 6530403ff8
commit 4e0a65c822
5 changed files with 190 additions and 48 deletions

View File

@@ -26,15 +26,6 @@ pub struct Deserializer<Iter: Iterator<Item = u8>> {
state: State,
}
// macro_rules! try_or_invalid {
// ($self_:expr, $e:expr) => {
// match $e {
// Some(v) => v,
// None => { return Err($self_.error(ErrorCode::InvalidNumber)); }
// }
// }
// }
impl<Iter> Deserializer<Iter>
where
Iter: Iterator<Item = u8>,