]> Repositorios git - scryer-prolog.git/commitdiff
check for ChildCloseList in print_struct on [] (#2039)
authorMark <[email protected]>
Thu, 28 Sep 2023 00:16:23 +0000 (18:16 -0600)
committerMark <[email protected]>
Thu, 28 Sep 2023 00:16:23 +0000 (18:16 -0600)
src/heap_print.rs

index 36afce781b72e547a8e9ed6e16130fe7a9b3b00a..b414a4840beed0a9cc3e7817467e71f0f534129c 100644 (file)
@@ -1521,10 +1521,13 @@ 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;
+                match printer.state_stack.last() {
+                    Some(TokenOrRedirect::CloseList(_) | TokenOrRedirect::ChildCloseList) => {
+                        if printer.at_cdr("") {
+                            return;
+                        }
                     }
+                    _ => {}
                 }
 
                 append_str!(printer, "[]");