Merge pull request #449 from notoria/read
Completed read/1, ctrl-d is end_of_file
This commit is contained in:
@@ -1301,6 +1301,15 @@ pub(crate) trait CallPolicy: Any + fmt::Debug {
|
|||||||
let addr = machine_st[temp_v!(1)];
|
let addr = machine_st[temp_v!(1)];
|
||||||
machine_st.unify(addr, Addr::HeapCell(offset.heap_loc));
|
machine_st.unify(addr, Addr::HeapCell(offset.heap_loc));
|
||||||
}
|
}
|
||||||
|
Err(ParserError::UnexpectedEOF) => {
|
||||||
|
let addr = machine_st[temp_v!(1)];
|
||||||
|
let eof = clause_name!("end_of_file".to_string(),
|
||||||
|
indices.atom_tbl);
|
||||||
|
let atom = machine_st.heap.to_unifiable(
|
||||||
|
HeapCellValue::Atom(eof, None)
|
||||||
|
);
|
||||||
|
machine_st.unify(addr, atom);
|
||||||
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let h = machine_st.heap.h();
|
let h = machine_st.heap.h();
|
||||||
let stub = MachineError::functor_stub(clause_name!("read"), 1);
|
let stub = MachineError::functor_stub(clause_name!("read"), 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user