consume whitespace before reading a term in loader.pl, modify prolog_load_context at file key to better reflect loading context, use it when reporting singleton variables (#812)

This commit is contained in:
Mark Thom
2021-02-22 13:23:22 -07:00
parent 5f8bdc564b
commit 1a9f6f06df
6 changed files with 62 additions and 70 deletions

View File

@@ -3888,54 +3888,6 @@ impl MachineState {
self.unify(a1, a2);
}
/*
&SystemClauseType::GetClause => {
let head = self[temp_v!(1)];
let subsection = match self.store(self.deref(head)) {
Addr::Str(s) => match &self.heap[s] {
&HeapCellValue::NamedStr(arity, ref name, ..) => {
indices.get_clause_subsection(
name.owning_module(),
name.clone(),
arity,
)
}
_ => {
unreachable!()
}
},
Addr::Con(h) if self.heap.atom_at(h) => {
if let &HeapCellValue::Atom(ref name, _) = &self.heap[h] {
indices.get_clause_subsection(
name.owning_module(),
name.clone(),
0,
)
} else {
unreachable!()
}
}
_ => {
unreachable!()
}
};
match subsection {
Some(dynamic_predicate_info) => {
self.execute_at_index(
2,
dir_entry!(dynamic_predicate_info.clauses_subsection_p),
);
return Ok(());
}
_ => {
unreachable!()
}
}
}
*/
&SystemClauseType::GetCutPoint => {
let a1 = self[temp_v!(1)];
let a2 = Addr::CutPoint(self.b0);
@@ -5496,6 +5448,18 @@ impl MachineState {
}
}
}
&SystemClauseType::DevourWhitespace => {
let stream =
self.get_stream_or_alias(self[temp_v!(1)], indices, "$devour_whitespace", 1)?;
match self.devour_whitespace(stream, self.atom_tbl.clone()) {
Ok(false) => {} // not at EOF.
_ => {
self.fail = true;
return Ok(());
}
}
}
};
return_from_clause!(self.last_call, self)