]> Repositorios git - scryer-prolog.git/commitdiff
additional write fixes, use rustyline 12.0.0 (#1876, #1901)
authorMark <[email protected]>
Sat, 22 Jul 2023 17:53:09 +0000 (11:53 -0600)
committerMark <[email protected]>
Sat, 22 Jul 2023 17:53:09 +0000 (11:53 -0600)
src/heap_print.rs

index 3463b0e0c4e78a4216b418975258b59fc4d59a77..9b0755d922b11ec731670f7ac44d1c15c3df310a 100644 (file)
@@ -1465,6 +1465,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
 
         let print_struct = |printer: &mut Self, name: Atom, arity: usize| {
             if name == atom!("[]") && arity == 0 {
+                if let Some(TokenOrRedirect::CloseList(_)) = printer.state_stack.last() {
+                    if printer.at_cdr("") {
+                        return;
+                    }
+                }
+
                 append_str!(printer, "[]");
             } else if arity > 0 {
                 if let Some(spec) = fetch_op_spec(name, arity, printer.op_dir) {
@@ -1516,7 +1522,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
             None => return,
         };
 
-        if !addr.is_compound(&self.iter.heap) && self.max_depth_exhausted(max_depth) {
+        if !addr.is_var() && !addr.is_compound(&self.iter.heap) && self.max_depth_exhausted(max_depth) {
             self.state_stack.push(TokenOrRedirect::Atom(atom!("...")));
             return;
         }