]> Repositorios git - scryer-prolog.git/commitdiff
pop pstr offsets from iterator stack in printer (#1290)
authorMark Thom <[email protected]>
Sat, 26 Feb 2022 06:36:26 +0000 (23:36 -0700)
committerMark Thom <[email protected]>
Sat, 26 Feb 2022 06:36:26 +0000 (23:36 -0700)
src/heap_print.rs

index 63e53d7384f49aad47e1f12a1cca264f44f22c67..a0231848345717a87c38a49e44d8f7d57639f11d 100644 (file)
@@ -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) => {