fuz_json_parser 0.1.2

a json parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{create_state, error, values::JsonValue};

pub mod parsers;
pub mod state;

pub fn parse<S: AsRef<str>>(json_str: S) -> error::Result<JsonValue> {
    let mut state = create_state!(json_str);
    state::consume_whitespace(&mut state);
    match state::peek(&mut state) {
        Some(_) => parsers::main_parse(&mut state),
        None => Ok(JsonValue::Null),
    }
}