printer: abbreviate lists with |
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "scryer-prolog"
|
||||
version = "0.8.66"
|
||||
version = "0.8.67"
|
||||
authors = ["Mark Thom <markjordanthom@gmail.com>"]
|
||||
repository = "https://github.com/mthom/scryer-prolog"
|
||||
description = "A modern Prolog implementation written mostly in Rust."
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = []"]]);
|
||||
|
||||
Reference in New Issue
Block a user