add expand_goal, make user:term_expansion and user:goal_expansion work properly within modules

This commit is contained in:
Mark Thom
2018-12-11 22:57:11 -07:00
parent 226bb7f9ed
commit 45a68d4bc2
11 changed files with 196 additions and 98 deletions

View File

@@ -267,8 +267,8 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter>
for key in self.heap_locs.keys().cloned() {
self.printed_vars.insert(key);
}
}
}
fn enqueue_op(&mut self, ct: ClauseType, fixity: Fixity) {
match fixity {
Fixity::Post => {
@@ -528,7 +528,11 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter>
HeapCellValue::Addr(Addr::Con(c)) =>
self.print_constant(c, &op),
HeapCellValue::Addr(Addr::Lis(_)) =>
self.push_list(),
if self.ignore_ops {
self.format_struct(2, clause_name!("."))
} else {
self.push_list()
},
HeapCellValue::Addr(addr) =>
if let Some(offset_str) = self.offset_as_string(addr) {
push_space_if_amb!(self, &offset_str, &op, {
@@ -572,9 +576,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter>
TokenOrRedirect::Open =>
self.outputter.append("("),
TokenOrRedirect::OpenList(delimit) =>
if self.ignore_ops {
self.format_struct(2, clause_name!("."));
} else if !self.at_cdr(", ") {
if !self.at_cdr(", ") {
self.outputter.append("[");
} else {
delimit.set(false);