correct copier.
This commit is contained in:
@@ -3,20 +3,12 @@ use prolog::instructions::*;
|
|||||||
|
|
||||||
use std::ops::IndexMut;
|
use std::ops::IndexMut;
|
||||||
|
|
||||||
//type ListTrail = HashMap<usize, usize>;
|
|
||||||
type Trail = Vec<(Ref, HeapCellValue)>;
|
type Trail = Vec<(Ref, HeapCellValue)>;
|
||||||
|
|
||||||
pub(crate) struct RedirectInfo {
|
pub(crate) struct RedirectInfo {
|
||||||
//list_trail: ListTrail,
|
|
||||||
trail: Trail
|
trail: Trail
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
impl RedirectInfo {
|
|
||||||
fn new() -> Self {
|
|
||||||
RedirectInfo { list_trail: ListTrail::new(), trail: Trail::new() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
pub(crate) trait CopierTarget
|
pub(crate) trait CopierTarget
|
||||||
{
|
{
|
||||||
fn source(&self) -> usize;
|
fn source(&self) -> usize;
|
||||||
@@ -59,7 +51,6 @@ pub(crate) trait CopierTarget
|
|||||||
fn duplicate_term_impl(&mut self, addr: Addr) -> RedirectInfo
|
fn duplicate_term_impl(&mut self, addr: Addr) -> RedirectInfo
|
||||||
where Self: IndexMut<usize, Output=HeapCellValue>
|
where Self: IndexMut<usize, Output=HeapCellValue>
|
||||||
{
|
{
|
||||||
// let mut redirect_info = RedirectInfo::new();
|
|
||||||
let mut trail = Trail::new();
|
let mut trail = Trail::new();
|
||||||
let mut scan = self.source();
|
let mut scan = self.source();
|
||||||
let old_h = self.threshold();
|
let old_h = self.threshold();
|
||||||
|
|||||||
@@ -60,10 +60,8 @@ impl<'a> HCPreOrderIterator<'a> {
|
|||||||
|
|
||||||
da
|
da
|
||||||
},
|
},
|
||||||
Addr::HeapCell(_) | Addr::StackCell(_, _) =>
|
Addr::HeapCell(_) | Addr::StackCell(_, _) => da,
|
||||||
da,
|
Addr::Str(s) => self.follow_heap(s) // record terms of structure.
|
||||||
Addr::Str(s) =>
|
|
||||||
self.follow_heap(s) // record terms of structure.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user