make clause/2 global in scope
This commit is contained in:
@@ -873,25 +873,20 @@ impl MachineState {
|
|||||||
&SystemClauseType::GetClause => {
|
&SystemClauseType::GetClause => {
|
||||||
let head = self[temp_v!(1)].clone();
|
let head = self[temp_v!(1)].clone();
|
||||||
|
|
||||||
let (module, subsection) = match self.store(self.deref(head)) {
|
let subsection = match self.store(self.deref(head)) {
|
||||||
Addr::Str(s) =>
|
Addr::Str(s) =>
|
||||||
match self.heap[s].clone() {
|
match self.heap[s].clone() {
|
||||||
HeapCellValue::NamedStr(arity, name, ..) =>
|
HeapCellValue::NamedStr(arity, name, ..) =>
|
||||||
(name.owning_module(), indices.get_clause_subsection(name, arity)),
|
indices.get_clause_subsection(name, arity),
|
||||||
_ => unreachable!()
|
_ => unreachable!()
|
||||||
},
|
},
|
||||||
Addr::Con(Constant::Atom(name, _)) =>
|
Addr::Con(Constant::Atom(name, _)) =>
|
||||||
(name.owning_module(), indices.get_clause_subsection(name, 0)),
|
indices.get_clause_subsection(name, 0),
|
||||||
_ => unreachable!()
|
_ => unreachable!()
|
||||||
};
|
};
|
||||||
|
|
||||||
match subsection {
|
match subsection {
|
||||||
Some(dynamic_predicate_info) => {
|
Some(dynamic_predicate_info) => {
|
||||||
if dynamic_predicate_info.module_src != module {
|
|
||||||
self.fail = true;
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
self.execute_at_index(2, dynamic_predicate_info.clauses_subsection_p);
|
self.execute_at_index(2, dynamic_predicate_info.clauses_subsection_p);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user