From 0dcd9e58055a32046e7811e30fb72a0db2825bf2 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sun, 27 Oct 2019 14:18:32 -0600 Subject: [PATCH] correct sign/1 (#216) --- src/prolog/heap_print.rs | 3 ++- src/prolog/machine/machine_state_impl.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/prolog/heap_print.rs b/src/prolog/heap_print.rs index 2c1ce6a0..0f9f7985 100644 --- a/src/prolog/heap_print.rs +++ b/src/prolog/heap_print.rs @@ -329,7 +329,8 @@ pub fn requires_space(atom: &str, op: &str) -> bool { .next() .map(|oc| { if ac == '0' { - oc == 'b' || oc == 'x' || oc == 'o' || oc == '\'' || alpha_numeric_char!(oc) + oc == 'b' || oc == 'x' || oc == 'o' || oc == '\'' + || oc == '(' || alpha_numeric_char!(oc) } else if alpha_numeric_char!(ac) { oc == '(' || alpha_numeric_char!(oc) } else if graphic_token_char!(ac) { diff --git a/src/prolog/machine/machine_state_impl.rs b/src/prolog/machine/machine_state_impl.rs index 5d6b5fbc..0bbdcf38 100644 --- a/src/prolog/machine/machine_state_impl.rs +++ b/src/prolog/machine/machine_state_impl.rs @@ -1381,9 +1381,9 @@ impl MachineState { if n.is_positive() { Integer::from(1) } else if n.is_negative() { - Integer::from(0) - } else { Integer::from(-1) + } else { + Integer::from(0) } } -- 2.54.0