Skip to content

Commit f368fac

Browse files
committed
More debug print improvements
1 parent 70c49a5 commit f368fac

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/grammar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ impl<'a, 'b, A> fmt::Display for ProductionDisplay<'a, 'b, A> {
364364
write!(f, "{}", nt.non_terminal)?;
365365
}
366366
SymbolKind::Terminal(t) => {
367+
let t = self.grammar.get_terminal(*t);
367368
write!(f, "{:?}", t)?;
368369
}
369370
}

src/lr_common.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ impl<A: fmt::Debug + Eq> LRTableBuilder<A> {
7474
}
7575
LRAction::Reduce(_nt_, _p_, _) => {
7676
// TODO: Allowing overriding reduce actions for shift for now
77+
// let production = grammar.get_production(nt_, p_);
7778
// panic!(
78-
// "({}, {:?}): Overriding Reduce({}, {}) action with Shift({})",
79+
// "({}, {:?}): Overriding Reduce({} -> {}) action with Shift({})",
7980
// state.0,
8081
// grammar.get_terminal(token),
81-
// nt_.0,
82-
// p_.0,
82+
// grammar.get_non_terminal(nt_).non_terminal,
83+
// ProductionDisplay::new(production, grammar),
8384
// next_state.0,
8485
// );
8586
}

0 commit comments

Comments
 (0)