Uses old Rust 2015
0.1.1 |
|
---|---|
0.1.0 |
|
#14 in #macro-use
23 downloads per month
Used in yass-serializer
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);
}