use crate::expr::ExprValue;
#[derive(Clone)]
pub struct Chunk {
pub(crate) instructions: Vec<u8>,
pub(crate) lines: Vec<usize>,
pub(crate) literals: Vec<ExprValue>,
pub(crate) num_variables: usize,
pub(crate) arity: usize,
}
impl Chunk {
pub(crate) fn new(
instructions: Vec<u8>,
lines: Vec<usize>,
literals: Vec<ExprValue>,
num_variables: usize,
arity: usize,
) -> Self {
assert_eq!(lines.len(), instructions.len());
Self {
instructions,
lines,
literals,
num_variables,
arity,
}
}
}