}
}
- fn intercept_constant(&mut self, constant: &Constant, index: usize) {
+ fn intercept_overlapping_constant(&mut self, constant: &Constant, index: usize) {
match constant {
&Constant::Atom(ref name, ref op) if name.is_char() => {
let c = name.as_str().chars().next().unwrap();
self.lists.push(Self::add_index(is_initial_index, index));
}
&Term::Constant(_, ref constant) => {
- self.intercept_constant(constant, index);
+ self.intercept_overlapping_constant(constant, index);
let code = self.constants
.entry(constant.clone())
}
}
- pub fn as_constant(&self, machine_st: &MachineState) -> Option<Constant> {
+ pub fn as_constant_index(&self, machine_st: &MachineState) -> Option<Constant> {
match self {
&Addr::Char(c) => {
Some(Constant::Char(c))
&Addr::Con(h) => {
match &machine_st.heap[h] {
&HeapCellValue::Atom(ref name, ref op) => {
- Some(Constant::Atom(name.clone(), op.clone()))
+ Some(Constant::Atom(name.clone(), None))
}
&HeapCellValue::Integer(ref n) => {
Some(Constant::Integer(n.clone()))