From: Mark Thom Date: Fri, 26 Apr 2019 15:48:12 +0000 (-0600) Subject: printer: abbreviate lists with | X-Git-Tag: v0.8.110~82 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=7bda7c5bf37809e8ad8add4dcd7cff04500f27ba;p=scryer-prolog.git printer: abbreviate lists with | --- diff --git a/Cargo.toml b/Cargo.toml index a7033886..8374e5be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scryer-prolog" -version = "0.8.66" +version = "0.8.67" authors = ["Mark Thom "] repository = "https://github.com/mthom/scryer-prolog" description = "A modern Prolog implementation written mostly in Rust." diff --git a/src/prolog/heap_print.rs b/src/prolog/heap_print.rs index 8757b3b7..431f698b 100644 --- a/src/prolog/heap_print.rs +++ b/src/prolog/heap_print.rs @@ -609,11 +609,9 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> self.cyclic_terms.insert(addr, reps - 1); iter.next() } else { - if !self.at_cdr(", ...") { - push_space_if_amb!(self, "...", { - self.append_str("..."); - }); - } + push_space_if_amb!(self, "...", { + self.append_str("..."); + }); iter.stack().pop(); self.cyclic_terms.remove(&addr); diff --git a/src/tests.rs b/src/tests.rs index 46e09ff9..5f9e8270 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1638,7 +1638,7 @@ fn test_queries_on_builtins() assert_prolog_failure!(&mut wam, "Pairs = [a-a|Pairs], keysort(Pairs, _)."); assert_prolog_success!(&mut wam, "Pairs = [a-a|Pairs], catch(keysort(Pairs, _), error(E, _), true).", - [["E = type_error(list, [a-a, a-a, a-a, ...])", "Pairs = [a-a | Pairs]"]]); + [["E = type_error(list, [a-a, a-a, a-a | ...])", "Pairs = [a-a | Pairs]"]]); assert_prolog_success!(&mut wam, "keysort([], L).", [["L = []"]]);