Merge pull request #1077 from pmoura/fix_get_code_predicates_at_end_of_file

Fix the get_code/1-2 predicates to return -1 at the end of stream as per standard
This commit is contained in:
Mark Thom
2021-11-07 09:40:29 -05:00
committed by GitHub

View File

@@ -2431,10 +2431,10 @@ impl MachineState {
}
if stream.at_end_of_stream() {
let end_of_file = clause_name!("end_of_file");
let end_of_file = Integer::from(-1);
let end_of_file = self
.heap
.to_unifiable(HeapCellValue::Atom(end_of_file, None));
.to_unifiable(HeapCellValue::Integer(Rc::new(end_of_file)));
stream.set_past_end_of_stream();