From 1109e05e06769e4aabbc61b42d5e1bd7ed6a3b74 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 1 Sep 2022 21:14:50 -0600 Subject: [PATCH] properly match strings concluding with characters in lists (#1597) --- src/machine/partial_string.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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]) -- 2.54.0