]> Repositorios git - scryer-prolog.git/commitdiff
correct sign/1 (#216)
authorMark Thom <[email protected]>
Sun, 27 Oct 2019 20:18:32 +0000 (14:18 -0600)
committerMark Thom <[email protected]>
Sun, 27 Oct 2019 20:18:32 +0000 (14:18 -0600)
src/prolog/heap_print.rs
src/prolog/machine/machine_state_impl.rs

index 2c1ce6a01b851c1a3809139ac77f0951c4c1dcde..0f9f798527a42d6ad8892eb26b301910d1916e64 100644 (file)
@@ -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) {
index 5d6b5fbcc5140815c83c177e26fd23a254da5150..0bbdcf38cdb2657c9ab476d3903307b282d8b90f 100644 (file)
@@ -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)
         }
     }