]> Repositorios git - scryer-prolog.git/commitdiff
properly match strings concluding with characters in lists (#1597)
authorMark Thom <[email protected]>
Fri, 2 Sep 2022 03:14:50 +0000 (21:14 -0600)
committerMark Thom <[email protected]>
Thu, 27 Oct 2022 05:36:07 +0000 (23:36 -0600)
src/machine/partial_string.rs

index cdc424dd8676975bb6ae2d21c59d7262ace84403..fce472041ce6c19c37d78d8d9100a379fb6135ea 100644 (file)
@@ -179,6 +179,14 @@ impl<'a> HeapPStrIter<'a> {
             if self.at_string_terminator() {
                 self.focus = empty_list_as_cell!();
                 self.brent_st.hare = result.focus;
+            } else {
+                read_heap_cell!(self.heap[result.focus],
+                    (HeapCellValueTag::Lis | HeapCellValueTag::Str) => {
+                        self.focus = self.heap[self.brent_st.hare];
+                    }
+                    _ => {
+                    }
+                );
             }
         }
 
@@ -330,7 +338,7 @@ impl<'a> HeapPStrIter<'a> {
                         })
                     } else {
                         None
-                    }
+                    };
                 }
                 (HeapCellValueTag::Str, s) => {
                     let (name, arity) = cell_as_atom_cell!(self.heap[s])