1
2use crate::{human::*, theory::*};
3
4use alloc::string::String;
5use core::{fmt::Write, str};
6
7pub fn runner(out: &mut String, input: &str) {
9 let mut dict = Dict::new();
10
11 let inp = match parse(input, &mut dict) {
12 Ok(k) => k,
13 Err(e) => {
14 let _ = write!(out, "parse error at byte {}: {}\n", e.byte, e.msg);
15 return;
16 }
17 };
18
19 let mut exp = lore(Kind::from((inp, lore_end())));
20 let _ = write!(out, "exp: {}\n", unparse(&exp, &dict));
22
23 match eta(&mut exp) {
24 Ok(res) => { let _ = write!(out, "[^] {}\n", unparse(&res, &dict)); }
25 Err(res) => { let _ = write!(out, "[H] {}\n", unparse(&res, &dict)); }
26 }
27}