remove string/1, use a more general test for the partial_string/1 type test (#328)
This commit is contained in:
@@ -2364,14 +2364,16 @@ impl MachineState {
|
||||
Some(iter.first_to_expire)
|
||||
}
|
||||
|
||||
pub(super) fn reset_block(&mut self, addr: Addr) {
|
||||
pub(super)
|
||||
fn reset_block(&mut self, addr: Addr) {
|
||||
match self.store(addr) {
|
||||
Addr::Usize(b) => self.block = b,
|
||||
_ => self.fail = true,
|
||||
};
|
||||
}
|
||||
|
||||
pub(super) fn execute_inlined(&mut self, inlined: &InlinedClauseType) {
|
||||
pub(super)
|
||||
fn execute_inlined(&mut self, inlined: &InlinedClauseType) {
|
||||
match inlined {
|
||||
&InlinedClauseType::CompareNumber(cmp, ref at_1, ref at_2) => {
|
||||
let n1 = try_or_fail!(self, self.get_number(at_1));
|
||||
@@ -2466,14 +2468,6 @@ impl MachineState {
|
||||
}
|
||||
};
|
||||
}
|
||||
&InlinedClauseType::IsString(r1) => {
|
||||
let d = self.store(self.deref(self[r1]));
|
||||
|
||||
match d {
|
||||
Addr::PStrLocation(..) => self.p += 1,
|
||||
_ => self.fail = true,
|
||||
};
|
||||
}
|
||||
&InlinedClauseType::IsNonVar(r1) => {
|
||||
let d = self.store(self.deref(self[r1]));
|
||||
|
||||
|
||||
@@ -1196,15 +1196,20 @@ impl MachineState {
|
||||
}
|
||||
}
|
||||
&SystemClauseType::IsPartialString => {
|
||||
let pstr = self.store(self.deref(self[temp_v!(1)]));
|
||||
let mut heap_pstr_iter = self.heap_pstr_iter(self[temp_v!(1)]);
|
||||
|
||||
match pstr {
|
||||
Addr::PStrLocation(..) => {
|
||||
}
|
||||
_ => {
|
||||
self.fail = true;
|
||||
}
|
||||
}
|
||||
while let Some(_) = heap_pstr_iter.next() {}
|
||||
|
||||
self.fail =
|
||||
match heap_pstr_iter.focus() {
|
||||
Addr::AttrVar(_) | Addr::HeapCell(_) | Addr::StackCell(..) |
|
||||
Addr::EmptyList => {
|
||||
false
|
||||
}
|
||||
_ => {
|
||||
true
|
||||
}
|
||||
};
|
||||
}
|
||||
&SystemClauseType::PartialStringTail => {
|
||||
let pstr = self.store(self.deref(self[temp_v!(1)]));
|
||||
|
||||
Reference in New Issue
Block a user