main: Print span of expressions, by parsing them as Anno

This commit is contained in:
2025-11-02 01:10:36 -04:00
parent 719f98917b
commit bb10056f38

View File

@@ -198,7 +198,7 @@ fn parse(document: &str) {
Ok("false" | "0" | "no")
);
for idx in 0.. {
match parser.parse::<Expr>(0) {
match parser.parse::<Anno<Expr>>(0) {
Err(e @ ParseError::EOF(s)) if s.tail == document.len() as _ => {
println!(
"\x1b[92m{e} (total {} byte{}, {idx} expression{})\x1b[0m",
@@ -222,7 +222,7 @@ fn parse(document: &str) {
break;
}
Ok(v) if verbose => {
println!("\x1b[{}m{v}", (idx + 5) % 6 + 31);
println!("\x1b[{}m{}: {v}", (idx + 5) % 6 + 31, v.1);
}
_ => {}
}