git.delta.rocks / jrsonnet / refs/commits / 8e8bdf291c75

difftreelog

feat prettier AST printing

Yaroslav Bolyukin2021-05-23parent: #0be1df1.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth
329pub 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