read from streams.

This commit is contained in:
Mark Thom
2019-04-13 18:40:17 -06:00
parent ed17867be0
commit ae90554378
25 changed files with 1657 additions and 1318 deletions

View File

@@ -1,5 +1,6 @@
use prolog::machine::machine_indices::*;
use std::mem;
use std::ops::{Index, IndexMut};
use std::vec::Vec;
@@ -74,6 +75,11 @@ impl OrStack {
self.0.push(Frame::new(global_index, e, cp, attr_var_init_b, b, bp, tr, pstr_tr, h, b0, n));
}
#[inline]
pub(crate) fn take(&mut self) -> Self {
OrStack(mem::replace(&mut self.0, vec![]))
}
pub fn len(&self) -> usize {
self.0.len()
}