[−][src]Crate json_peek
json-peek
is an amature json parser library design for my specific need.
Don't expect this to be efficient or perfect.
This library will parse json file while also maintain positional information which work really well with codespan-reporting
let content = r#" { "display": { "title": "Installed Datapacks", "description": "", "icon": { "item": "minecraft:knowledge_book" }, "background": "minecraft:textures/block/gray_concrete.png", "show_toast": false, "announce_to_chat": false }, "criteria": { "trigger": { "trigger": "minecraft:tick" } } } "#; let parse_result = util::from_str(content).expect("Invalid json"); let title = parse_result.get("display").get("title").expect("Title doesn't exist"); assert_eq!(title, "Installed Datapacks");
Re-exports
pub use value::Value; |
pub use value::Indexable; |
pub use value::Keyable; |
pub use parser::Parser; |
pub use lexer::Lexer; |
Modules
lexer | Lexer module which parse string into usable Token |
parser | Parser module which handling interpreting Token into JSON AST |
util | Utility module |
value |
Structs
Token | A single point of string that represent a useful symbol for Parser to use |