From: Mark Date: Thu, 28 Sep 2023 00:16:23 +0000 (-0600) Subject: check for ChildCloseList in print_struct on [] (#2039) X-Git-Tag: remove~73 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=035e214ef52917ca2fa994bf3988cf3d23c8b040;p=scryer-prolog.git check for ChildCloseList in print_struct on [] (#2039) --- diff --git a/src/heap_print.rs b/src/heap_print.rs index 36afce78..b414a484 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -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, "[]");