]> Repositorios git - scryer-prolog.git/commitdiff
correct failed partial string matching (#483)
authorMark Thom <[email protected]>
Sun, 10 May 2020 20:00:49 +0000 (14:00 -0600)
committerMark Thom <[email protected]>
Sun, 10 May 2020 20:00:49 +0000 (14:00 -0600)
src/prolog/machine/machine_state_impl.rs

index aa7cb9113ab1fac28befa65f069896ee168e83d9..a64685c57e46ad67e44aeadd2e4ce13b5d326935 100644 (file)
@@ -796,7 +796,7 @@ impl MachineState {
                             if let Some(var) = addr.as_var() {
                                 self.bind(var, Addr::EmptyList);
                             } else {
-                                self.fail = true;
+                                self.fail = addr != Addr::EmptyList;
                             }
                         }
                     }
@@ -804,9 +804,7 @@ impl MachineState {
             }
             Some(prefix_len) => {
                 match heap_pstr_iter.focus() {
-                    addr @ Addr::AttrVar(_) |
-                    addr @ Addr::StackCell(..) |
-                    addr @ Addr::HeapCell(_) => {
+                    addr if addr.is_ref() => {
                         let h = self.heap.h();
 
                         let pstr_addr =