issue singleton variable warnings from loader.pl (#812)

This commit is contained in:
Mark Thom
2021-02-21 19:18:06 -07:00
parent a323a4dd8e
commit 0ef5f7f9b1
12 changed files with 178 additions and 63 deletions

View File

@@ -4534,8 +4534,17 @@ impl MachineState {
}
}
"position" => {
if let Some(position) = stream.position() {
HeapCellValue::Addr(Addr::Usize(position as usize))
if let Some((position, lines_read)) = stream.position() {
let h = self.heap.h();
let position_term = functor!(
"position_and_lines_read",
[integer(position), integer(lines_read)]
);
self.heap.extend(position_term.into_iter());
HeapCellValue::Addr(Addr::HeapCell(h))
} else {
self.fail = true;
return Ok(());
@@ -4543,7 +4552,6 @@ impl MachineState {
}
"end_of_stream" => {
let end_of_stream_pos = stream.position_relative_to_end();
HeapCellValue::Atom(clause_name!(end_of_stream_pos.as_str()), None)
}
"eof_action" => HeapCellValue::Atom(