diff --git a/src/frame.rs b/src/frame.rs index e98c4c8..c7a69b1 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -4,7 +4,7 @@ use stack::Stack; #[derive(Debug)] pub struct Frame { pub stack: Stack, - locals: Vec, + pub locals: Vec, } impl Frame { @@ -18,6 +18,14 @@ impl Frame { } } + pub fn len(&self) -> usize { + self.locals.len() + } + + pub fn is_empty(&self) -> bool { + self.locals.is_empty() + } + pub fn get(&self, offset: usize) -> Result { if offset >= self.locals.len() { return Err("Local variable out of range");