read from streams.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user