look up operator precedence when arity does not match what the atom records, don't print brackets around outermost '+' (#629)

This commit is contained in:
Mark Thom
2020-07-17 11:02:58 -06:00
parent 6c691d9223
commit f0c8056334
5 changed files with 59 additions and 23 deletions

View File

@@ -3895,9 +3895,13 @@ impl MachineState {
}
},
Addr::Con(h) if self.heap.atom_at(h) => {
if let &HeapCellValue::Atom(ref name, ref spec) = &self.heap[h] {
if let &HeapCellValue::Atom(ref name, ref spec) = &self.heap[h] {
let module = name.owning_module();
let spec = fetch_atom_op_spec(name.clone(), spec.clone(), &indices.op_dir);
let spec = fetch_atom_op_spec(
name.clone(),
spec.clone(),
&indices.op_dir,
);
indices.predicate_exists(name.clone(), module, 0, spec)
} else {