#yass #parser #macro-use

yanked yass-parser

YASS parser

Uses old Rust 2015

0.1.1 Apr 10, 2018
0.1.0 Apr 2, 2018

#7 in #macro-use


Used in yass-serializer

MIT/Apache

48KB
924 lines

YASS parser

Example

#[macro_use]
extern crate yass;
extern crate yass_parser;

fn main() {
    // (example)
    // key1 "value1"
    // key2 value2
    // key3 -1.0
    let text = b"(example)\nkey1 \"value1\"\nkey2 value2\nkey3 -1.0";
    
    let parser_limits = yass_parser::ParserLimits::unlimited();
    let (parsed, pos_map) = yass_parser::parse(parser_limits, text).unwrap();
    
    let expected = yass_document!(
        ("example")
        "key1": r#""value1""#,
        "key2": "value2",
        "key3": "-1.0"
    );
    assert_eq!(parsed, expected);
}

Dependencies