resurgence 0.1.4

A VM backend library that makes developing interpreters easy. Can be used either as an entire backend, or to create a backend
Documentation
use crate::constant::Constant;
/// `StackFrame`: Represents a stack frame.
/// 
/// `registers` (`Vec<Constant>`): Represents the registers of the stack frame
pub struct StackFrame {
    pub registers: Vec<Constant>,
}

impl From<u32> for StackFrame
{
    /// Constructs a `StackFrame` object from a `u32`.
    /// 
    /// `size` (`u32`): Amount of elements to preallocate
    fn from(size: u32) -> Self {
        let mut new_frame = StackFrame { 
            registers: Vec::new() 
        };
        new_frame.registers.resize(size as usize, Constant::Int(0));
        new_frame
    }
}