rustine 0.1.1

High-performance Gel syntax parser transforming to JSON/XML (Rust + PyO3)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use rustine::parse_and_run;

/// When no statement matches the remaining input, a diagnostic trace is emitted.
#[test]
fn no_match_trace_on_stuck_grammar() {
    let src = "\
grammar main:
    match /foo/:
        out.create(\"root/found\")
";
    let json = parse_and_run(src, "main", "fooBAR").expect("exec");
    assert!(json.contains("\"found\""), "foo should match: {json}");
    assert!(
        json.contains("no match found"),
        "should have no-match trace for stuck input: {json}"
    );
}