From: Mark Thom Date: Sun, 28 Feb 2021 19:28:19 +0000 (-0700) Subject: pop non-composite terms from iter stack in is_cyclic_term X-Git-Tag: v0.9.0~150^2~5 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=08e2b601f1575e3e38b8c2f0a09115398a0b243a;p=scryer-prolog.git pop non-composite terms from iter stack in is_cyclic_term --- diff --git a/src/heap_print.rs b/src/heap_print.rs index 5e05d5b5..950b3ecd 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -392,21 +392,6 @@ pub(crate) fn requires_space(atom: &str, op: &str) -> bool { } } -/* -fn reverse_heap_locs<'a>(machine_st: &'a MachineState) -> ReverseHeapVarDict { - machine_st - .heap_locs - .iter() - .map(|(var, var_addr)| { - ( - machine_st.store(machine_st.deref(var_addr.clone())), - var.clone(), - ) - }) - .collect() -} -*/ - fn non_quoted_graphic_token>(mut iter: Iter, c: char) -> bool { if c == '/' { return match iter.next() { @@ -494,37 +479,6 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { max_depth: 0, } } - /* - pub(crate) fn from_heap_locs( - machine_st: &'a MachineState, - op_dir: &'a OpDir, - output: Outputter, - ) -> Self { - let mut printer = Self::new(machine_st, op_dir, output); - - printer.toplevel_spec = Some(DirectedOp::Right( - clause_name!("="), - SharedOpDesc::new(700, XFX), - )); - - printer.heap_locs = reverse_heap_locs(machine_st); - - printer - } - */ - /* - pub(crate) fn drop_toplevel_spec(&mut self) { - self.toplevel_spec = None; - } - */ - /* - #[inline] - pub(crate) fn see_all_locs(&mut self) { - for key in self.heap_locs.keys().cloned() { - self.printed_vars.insert(key); - } - } - */ #[inline] fn ambiguity_check(&self, atom: &str) -> bool { diff --git a/src/machine/machine_state_impl.rs b/src/machine/machine_state_impl.rs index b4486366..6ca1341a 100644 --- a/src/machine/machine_state_impl.rs +++ b/src/machine/machine_state_impl.rs @@ -1749,6 +1749,8 @@ impl MachineState { fail = true; break; } + } else { + iter.stack().pop(); } }