From: Mark Thom Date: Fri, 2 Sep 2022 03:14:50 +0000 (-0600) Subject: properly match strings concluding with characters in lists (#1597) X-Git-Tag: v0.9.1^2~20 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=1109e05e06769e4aabbc61b42d5e1bd7ed6a3b74;p=scryer-prolog.git properly match strings concluding with characters in lists (#1597) --- diff --git a/src/machine/partial_string.rs b/src/machine/partial_string.rs index cdc424dd..fce47204 100644 --- a/src/machine/partial_string.rs +++ b/src/machine/partial_string.rs @@ -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])