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;

#[test]
fn do_skip_stops_later_actions() {
    let grammar = "grammar g:\n    match /foo/:\n        out.create(\"root\")\n        do.skip()\n        out.add(\"root/after\")\n";
    let input = "foo";
    let json = parse_and_run(grammar, "g", input).expect("run");
    // Expect root node created; 'after' should not appear in the output tree
    assert!(json.contains("\"root\""), "expected root node: {json}");
    // The output section should not contain an 'after' node
    let output_idx = json.find("\"output\"").expect("output missing");
    let output_section = &json[output_idx..];
    assert!(
        !output_section.contains("\"after\""),
        "after should not be in output tree: {json}"
    );
}