From: Mark Thom Date: Wed, 19 Dec 2018 06:04:49 +0000 (-0700) Subject: eliminate ambiguity check on structs with non-zero arity X-Git-Tag: v0.8.110~309 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=9064f736550c195c3db55eab3e7a3bd9c6d3221e;p=scryer-prolog.git eliminate ambiguity check on structs with non-zero arity --- 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("[]");