From f6c995157e34e8dc71fa37dea16c7104042f81ba Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Tue, 14 Apr 2020 14:26:30 -0600 Subject: [PATCH] clean up print_list_like --- src/prolog/heap_print.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/prolog/heap_print.rs b/src/prolog/heap_print.rs index 16efd61c..186a2128 100644 --- a/src/prolog/heap_print.rs +++ b/src/prolog/heap_print.rs @@ -1057,10 +1057,10 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { addr: Addr, mut max_depth: usize, ) { - let a1 = iter.stack().pop(); - let a2 = iter.stack().pop(); - if self.check_max_depth(&mut max_depth) { + iter.stack().pop(); + iter.stack().pop(); + self.state_stack.push(TokenOrRedirect::Atom(clause_name!("..."))); return; } @@ -1071,13 +1071,13 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { let buf = heap_pstr_iter.to_string(); if buf.is_empty() { - iter.stack().push(a2.unwrap()); - iter.stack().push(a1.unwrap()); - self.push_list(iter, max_depth); return; } + iter.stack().pop(); + iter.stack().pop(); + let end_addr = heap_pstr_iter.focus(); let at_cdr = self.at_cdr(","); @@ -1349,7 +1349,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { if self.ignore_ops { self.format_struct(iter, max_depth, 2, clause_name!(".")); } else { - self.print_list_like(iter, Addr::Lis(l), max_depth); //self.push_list(iter, max_depth); + self.print_list_like(iter, Addr::Lis(l), max_depth); } } &HeapCellValue::Addr(addr) => { -- 2.54.0