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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user