From 26e4560429bb6601fd5ffeaeac1ce0c71304bfff Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Fri, 25 Feb 2022 23:36:26 -0700 Subject: [PATCH] pop pstr offsets from iterator stack in printer (#1290) --- src/heap_print.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/heap_print.rs b/src/heap_print.rs index 63e53d73..a0231848 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -1184,6 +1184,11 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { self.state_stack.push(TokenOrRedirect::Atom(atom!("..."))); self.state_stack.push(TokenOrRedirect::HeadTailSeparator); } else if end_cell != empty_list_as_cell!() { + if value.get_tag() != HeapCellValueTag::CStr { + self.iter.pop_stack(); + self.iter.push_stack(h+1); + } + self.state_stack.push(TokenOrRedirect::FunctorRedirect(max_depth)); self.state_stack.push(TokenOrRedirect::HeadTailSeparator); } @@ -1447,10 +1452,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { (HeapCellValueTag::F64, f) => { self.print_number(NumberFocus::Unfocused(Number::Float(**f)), &op); } - (HeapCellValueTag::PStrOffset) => { - self.print_list_like(max_depth); - } - (HeapCellValueTag::PStr | HeapCellValueTag::CStr) => { + (HeapCellValueTag::CStr | HeapCellValueTag::PStr | HeapCellValueTag::PStrOffset) => { self.print_list_like(max_depth); } (HeapCellValueTag::Lis) => { -- 2.54.0