From 9064f736550c195c3db55eab3e7a3bd9c6d3221e Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Tue, 18 Dec 2018 23:04:49 -0700 Subject: [PATCH] eliminate ambiguity check on structs with non-zero arity --- src/prolog/heap_print.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/prolog/heap_print.rs b/src/prolog/heap_print.rs index 3e963373..f119e7f7 100644 --- a/src/prolog/heap_print.rs +++ b/src/prolog/heap_print.rs @@ -14,7 +14,7 @@ use std::rc::Rc; #[derive(Clone)] pub enum DirectedOp { Left(ClauseName), - Right(ClauseName) + Right(ClauseName), } #[derive(Clone)] @@ -516,11 +516,15 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> self.state_stack.push(TokenOrRedirect::Open); } }, - HeapCellValue::NamedStr(arity, name, fixity) => + HeapCellValue::NamedStr(0, name, fixity) => push_space_if_amb!(self, name.as_str(), &op, { - let ct = ClauseType::from(name, arity, fixity); - self.format_clause(iter, arity, ct); + let ct = ClauseType::from(name, 0, fixity); + self.format_clause(iter, 0, ct); }), + HeapCellValue::NamedStr(arity, name, fixity) => { + let ct = ClauseType::from(name, arity, fixity); + self.format_clause(iter, arity, ct); + }, HeapCellValue::Addr(Addr::Con(Constant::EmptyList)) => if !self.at_cdr("") { self.outputter.append("[]"); -- 2.54.0