From 130c0df8b9fbfebe45fea9782a0382841a16e0d0 Mon Sep 17 00:00:00 2001 From: Arthur Paulino Date: Wed, 16 Aug 2023 08:14:47 -0300 Subject: [PATCH] rename debug display function --- src/lem/interpreter.rs | 2 +- src/lem/store.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lem/interpreter.rs b/src/lem/interpreter.rs index cfff4d2ced..fb5c2f8020 100644 --- a/src/lem/interpreter.rs +++ b/src/lem/interpreter.rs @@ -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)?; diff --git a/src/lem/store.rs b/src/lem/store.rs index a2db8a1893..8d9a0997bf 100644 --- a/src/lem/store.rs +++ b/src/lem/store.rs @@ -375,7 +375,7 @@ impl Store { } impl Ptr { - pub fn fmt_to_string(self, store: &Store) -> String { + pub fn dgb_display(self, store: &Store) -> String { if let Some(s) = store.fetch_string(&self) { return format!("\"{}\"", s); } @@ -395,8 +395,8 @@ impl Ptr { format!( "({} {} {})", tag, - (*p1).fmt_to_string(store), - (*p2).fmt_to_string(store) + (*p1).dgb_display(store), + (*p2).dgb_display(store) ) } Ptr::Tree3(tag, x) => { @@ -404,9 +404,9 @@ impl Ptr { 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) => { @@ -414,10 +414,10 @@ impl Ptr { 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) ) } }