From: Mark Thom Date: Sun, 27 Oct 2019 20:18:32 +0000 (-0600) Subject: correct sign/1 (#216) X-Git-Tag: v0.8.116~9 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=0dcd9e58055a32046e7811e30fb72a0db2825bf2;p=scryer-prolog.git correct sign/1 (#216) --- 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) } }