From 865699294578ec01cb142b8a5b6555842996bd0f Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 21 Oct 2019 19:11:27 -0700 Subject: [PATCH] Made parse trace output a bit nicer Used ... instead of whitespace, removed extraneous "Production" --- schala-lang/language/src/parsing.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/schala-lang/language/src/parsing.rs b/schala-lang/language/src/parsing.rs index 1df054a..da97c3c 100644 --- a/schala-lang/language/src/parsing.rs +++ b/schala-lang/language/src/parsing.rs @@ -262,12 +262,13 @@ impl Parser { pub fn format_parse_trace(&self) -> String { let mut buf = String::new(); + buf.push_str("Parse productions:\n"); for r in self.parse_record.iter() { let mut indent = String::new(); for _ in 0..r.level { - indent.push(' '); + indent.push('.'); } - buf.push_str(&format!("{}Production `{}`, token: {}\n", indent, r.production_name, r.next_token)) + buf.push_str(&format!("{}`{}`, next token: {}\n", indent, r.production_name, r.next_token)) } buf }