summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-07-21 16:21:00 +0800
committerJSDurand <mmemmew@gmail.com>2023-07-21 16:21:00 +0800
commit201830e33ab5c45044e960217e0ac8803e3e134d (patch)
treeb5e2f6275cf3245cc155cfabaac91beab56df75a /src/lib.rs
parent659c2195d2c224122cc8da813bec3af46084b61b (diff)
Add variations to the test
Add an intentionally ambiguous grammar for testing purposes. It seems to work fine.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b7252a3..7cc5223 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,6 +32,9 @@ impl Parser {
/// format.
pub fn new(s: &str) -> Result<Self, String> {
let grammar: Grammar = s.parse().map_err(|err| format!("{err}"))?;
+
+ println!("grammar: {grammar}");
+
let atom: DefaultAtom =
DefaultAtom::from_grammar(grammar).map_err(|err| format!("{err}"))?;
@@ -480,8 +483,8 @@ extern "C" fn parser_parse(
match forest {
Ok(forest) => {
- // use graph::Graph;
- // forest.print_viz("test forest.gv").unwrap();
+ use graph::Graph;
+ forest.print_viz("test forest.gv").unwrap();
Box::leak(parser_box);