add current_output, printing of stream terms

This commit is contained in:
Mark Thom
2020-03-11 00:38:01 -06:00
parent 25babff827
commit 4c88e97330
14 changed files with 236 additions and 32 deletions

View File

@@ -958,6 +958,20 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
self.push_list();
}
}
HeapCellValue::Addr(Addr::Stream(stream)) => {
if let Some(alias) = &stream.options.alias {
self.print_atom(alias);
} else {
if stream.is_stdout() || stream.is_stdin() {
self.append_str("user");
} else {
self.append_str(&format!(
"'$stream'(0x{:x})",
stream.as_ptr() as usize,
));
}
}
}
HeapCellValue::Addr(addr) => {
if let Some(offset_str) = self.offset_as_string(iter, addr) {
push_space_if_amb!(self, &offset_str, {