remove string/1, use a more general test for the partial_string/1 type test (#328)

This commit is contained in:
Mark Thom
2020-04-11 22:47:52 -06:00
parent 0499005db5
commit 4f0adad78e
5 changed files with 17 additions and 39 deletions

View File

@@ -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]));