add preliminary support for verify_attributes/3

This commit is contained in:
Mark Thom
2019-02-07 23:33:55 -07:00
parent 7c2f626d56
commit 661f9b7414
7 changed files with 159 additions and 60 deletions

View File

@@ -10,6 +10,7 @@ use prolog::num::{ToPrimitive, Zero};
use prolog::num::bigint::{BigInt};
use std::collections::HashSet;
use std::mem;
use std::rc::Rc;
struct BrentAlgState {
@@ -442,7 +443,17 @@ impl MachineState {
CWILCallPolicy.")
},
&SystemClauseType::RestoreCodePtrFromSpecialFormCP => {
self.p = self.special_form_cp.clone();
self.p = mem::replace(&mut self.attr_var_init.special_form_cp,
CodePtr::VerifyAttrInterrupt(self.attr_var_init.verify_attrs_loc));
mem::swap(&mut self.registers, &mut self.attr_var_init.registers);
let mut bindings = vec![];
mem::swap(&mut bindings, &mut self.attr_var_init.bindings);
for (h, addr) in bindings {
self.heap[h] = HeapCellValue::Addr(addr);
}
return Ok(());
},
&SystemClauseType::RestoreCutPolicy => {