difftreelog
feat prettier AST printing
in: master
1 file changed
crates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth329pub struct LocExpr(pub Rc<Expr>, pub Option<ExprLocation>);329pub struct LocExpr(pub Rc<Expr>, pub Option<ExprLocation>);330impl Debug for LocExpr {330impl Debug for LocExpr {331 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {331 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {332 if f.alternate() {332 write!(f, "{:?} from {:?}", self.0, self.1)333 write!(f, "{:#?}", self.0)?;334 } else {335 write!(f, "{:?}", self.0)?;336 }337 if let Some(loc) = &self.1 {338 write!(f, " from {:?}", loc)?;339 }340 Ok(())333 }341 }334}342}335343