From 4ef105cd0d3336b8755483cde43450d9f96abf4a Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 16 Jan 2017 14:18:56 -0800 Subject: parser: show values and descriptions in-line --- modelica-parser-lalrpop/src/ast.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modelica-parser-lalrpop/src/ast.rs b/modelica-parser-lalrpop/src/ast.rs index 317944b..041491a 100644 --- a/modelica-parser-lalrpop/src/ast.rs +++ b/modelica-parser-lalrpop/src/ast.rs @@ -260,13 +260,21 @@ impl Debug for ComponentPrefix { impl Debug for Component { fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> { - write!(fmt, "{}{} {}", + write!(fmt, "{}{} {}{}{}", match self.prefix { - Some(p) => format!("{:?} ", p), + Some(ref p) => format!("{:?} ", p), None => "".to_string(), }, self.specifier, self.name, + match self.value { + Some(ref p) => format!("={:?} ", p), + None => "".to_string(), + }, + match self.description { + Some(ref p) => format!(" {:?}", p), + None => "".to_string(), + }, ) } } -- cgit v1.2.3