Skip to content

Commit

Permalink
rename debug display function
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurpaulino committed Aug 16, 2023
1 parent 6148c7f commit 130c0df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lem/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl Block {
}
Op::Emit(a) => {
let a = bindings.get(a)?;
println!("{}", a.fmt_to_string(store))
println!("{}", a.dgb_display(store))
}
Op::Hash2(img, tag, preimg) => {
let preimg_ptrs = bindings.get_many_cloned(preimg)?;
Expand Down
20 changes: 10 additions & 10 deletions src/lem/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl<F: LurkField> Store<F> {
}

impl<F: LurkField> Ptr<F> {
pub fn fmt_to_string(self, store: &Store<F>) -> String {
pub fn dgb_display(self, store: &Store<F>) -> String {
if let Some(s) = store.fetch_string(&self) {
return format!("\"{}\"", s);
}
Expand All @@ -395,29 +395,29 @@ impl<F: LurkField> Ptr<F> {
format!(
"({} {} {})",
tag,
(*p1).fmt_to_string(store),
(*p2).fmt_to_string(store)
(*p1).dgb_display(store),
(*p2).dgb_display(store)
)
}
Ptr::Tree3(tag, x) => {
let (p1, p2, p3) = store.fetch_3_ptrs(x).unwrap();
format!(
"({} {} {} {})",
tag,
(*p1).fmt_to_string(store),
(*p2).fmt_to_string(store),
(*p3).fmt_to_string(store)
(*p1).dgb_display(store),
(*p2).dgb_display(store),
(*p3).dgb_display(store)
)
}
Ptr::Tree4(tag, x) => {
let (p1, p2, p3, p4) = store.fetch_4_ptrs(x).unwrap();
format!(
"({} {} {} {} {})",
tag,
(*p1).fmt_to_string(store),
(*p2).fmt_to_string(store),
(*p3).fmt_to_string(store),
(*p4).fmt_to_string(store)
(*p1).dgb_display(store),
(*p2).dgb_display(store),
(*p3).dgb_display(store),
(*p4).dgb_display(store)
)
}
}
Expand Down

0 comments on commit 130c0df

Please sign in to comment.