]> Repositorios git - scryer-prolog.git/commitdiff
pop non-composite terms from iter stack in is_cyclic_term
authorMark Thom <[email protected]>
Sun, 28 Feb 2021 19:28:19 +0000 (12:28 -0700)
committerMark Thom <[email protected]>
Sun, 28 Feb 2021 19:28:19 +0000 (12:28 -0700)
src/heap_print.rs
src/machine/machine_state_impl.rs

index 5e05d5b5fbfb35e9d09abc3c1959b6314b863d8c..950b3ecd7ade927bc46678a41912ce815db78bd3 100644 (file)
@@ -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<Iter: Iterator<Item = char>>(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 {
index b44863663e94b260e71347ab00085f049103c0c6..6ca1341acb6045537999db51b54c3edec72c76a9 100644 (file)
@@ -1749,6 +1749,8 @@ impl MachineState {
                         fail = true;
                         break;
                     }
+                } else {
+                    iter.stack().pop();
                 }
             }