Skip to content

Commit

Permalink
dump formulas in source order (metamath#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 authored Jan 14, 2025
1 parent 9043997 commit 26e5fe9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions metamath-rs/src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,9 +1736,14 @@ impl StmtParse {
println!("Formula Dump:");
let sset = db.parse_result();
let nset = db.name_result();
for sps in self.segments.values() {
for (&sa, formula) in &sps.formulas {
let sref = sset.statement(sa);
for seg in sset.segments(..) {
let Some(sps) = self.segments.get(&seg.id) else {
continue;
};
for sref in seg.range(..) {
let Some(formula) = sps.formulas.get(&sref.address()) else {
continue;
};
println!(
"{}: {}",
as_str(nset.statement_name(&sref)),
Expand Down

0 comments on commit 26e5fe9

Please sign in to comment.