main: Print span of expressions, by parsing them as Anno
This commit is contained in:
@@ -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);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user