fix #255 (I think?)
This commit is contained in:
@@ -164,7 +164,6 @@ pub enum SystemClauseType {
|
||||
CallContinuation,
|
||||
CharCode,
|
||||
CharsToNumber,
|
||||
ClearAttrVarBindings,
|
||||
ClearAttributeGoals,
|
||||
CloneAttributeGoals,
|
||||
CodesToNumber,
|
||||
@@ -295,7 +294,6 @@ impl SystemClauseType {
|
||||
&SystemClauseType::REPL(REPLCodePtr::UseQualifiedModuleFromFile) => {
|
||||
clause_name!("$use_qualified_module_from_file")
|
||||
}
|
||||
&SystemClauseType::ClearAttrVarBindings => clause_name!("$clear_attr_var_bindings"),
|
||||
&SystemClauseType::CopyToLiftedHeap => clause_name!("$copy_to_lh"),
|
||||
&SystemClauseType::DeleteAttribute => clause_name!("$del_attr_non_head"),
|
||||
&SystemClauseType::DeleteHeadAttribute => clause_name!("$del_attr_head"),
|
||||
@@ -424,7 +422,6 @@ impl SystemClauseType {
|
||||
("$call_continuation", 1) => Some(SystemClauseType::CallContinuation),
|
||||
("$char_code", 2) => Some(SystemClauseType::CharCode),
|
||||
("$chars_to_number", 2) => Some(SystemClauseType::CharsToNumber),
|
||||
("$clear_attr_var_bindings", 0) => Some(SystemClauseType::ClearAttrVarBindings),
|
||||
("$clear_attribute_goals", 0) => Some(SystemClauseType::ClearAttributeGoals),
|
||||
("$clone_attribute_goals", 1) => Some(SystemClauseType::CloneAttributeGoals),
|
||||
("$codes_to_number", 2) => Some(SystemClauseType::CodesToNumber),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
driver(Vars, Values) :-
|
||||
iterate(Vars, Values, ListOfListsOfGoalLists),
|
||||
'$clear_attr_var_bindings',
|
||||
!,
|
||||
call_goals(ListOfListsOfGoalLists),
|
||||
'$return_from_verify_attr'.
|
||||
@@ -17,13 +16,6 @@ gather_modules([Attr|Attrs], [Module|Modules]) :-
|
||||
'$module_of'(Module, Attr), % write the owning module of Attr to Module.
|
||||
gather_modules(Attrs, Modules).
|
||||
|
||||
verify_attrs([Module|Modules], Var, Value, [Goals|ListOfGoalLists]) :-
|
||||
catch(Module:verify_attributes(Var, Value, Goals),
|
||||
error(evaluation_error((Module:verify_attributes)/3), verify_attributes/3),
|
||||
Goals = []),
|
||||
verify_attrs(Modules, Var, Value, ListOfGoalLists).
|
||||
verify_attrs([], _, _, []).
|
||||
|
||||
call_verify_attributes(Attrs, _, _, []) :-
|
||||
var(Attrs), !.
|
||||
call_verify_attributes([], _, _, []).
|
||||
@@ -32,6 +24,13 @@ call_verify_attributes([Attr|Attrs], Var, Value, ListOfGoalLists) :-
|
||||
sort(Modules0, Modules),
|
||||
verify_attrs(Modules, Var, Value, ListOfGoalLists).
|
||||
|
||||
verify_attrs([Module|Modules], Var, Value, [Goals|ListOfGoalLists]) :-
|
||||
catch(Module:verify_attributes(Var, Value, Goals),
|
||||
error(evaluation_error((Module:verify_attributes)/3), verify_attributes/3),
|
||||
Goals = []),
|
||||
verify_attrs(Modules, Var, Value, ListOfGoalLists).
|
||||
verify_attrs([], _, _, []).
|
||||
|
||||
call_goals([ListOfGoalLists | ListsCubed]) :-
|
||||
call_goals_0(ListOfGoalLists),
|
||||
call_goals(ListsCubed).
|
||||
|
||||
@@ -73,11 +73,10 @@ impl MachineState {
|
||||
let iter = self
|
||||
.attr_var_init
|
||||
.bindings
|
||||
.iter()
|
||||
.map(|(_, ref addr)| addr.clone());
|
||||
.drain(0 ..)
|
||||
.map(|(_, addr)| addr);
|
||||
|
||||
let value_list_addr = Addr::HeapCell(self.heap.to_list(iter));
|
||||
|
||||
(var_list_addr, value_list_addr)
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,8 @@ impl MachineState {
|
||||
self.trail(TrailRef::from(Ref::PStrTail(h, pstr_len)));
|
||||
}
|
||||
|
||||
pub(super) fn bind(&mut self, r1: Ref, a2: Addr) {
|
||||
pub(super)
|
||||
fn bind(&mut self, r1: Ref, a2: Addr) {
|
||||
let t1 = self.store(r1.as_addr());
|
||||
let t2 = self.store(a2.clone());
|
||||
|
||||
|
||||
@@ -1973,9 +1973,6 @@ impl MachineState {
|
||||
}
|
||||
};
|
||||
}
|
||||
&SystemClauseType::ClearAttrVarBindings => {
|
||||
self.attr_var_init.bindings.clear();
|
||||
}
|
||||
&SystemClauseType::RedoAttrVarBinding => {
|
||||
let var = self.store(self.deref(self[temp_v!(1)].clone()));
|
||||
let value = self.store(self.deref(self[temp_v!(2)].clone()));
|
||||
|
||||
Reference in New Issue
Block a user