xbasic 0.3.2

A library that allows adding a scripting language onto your project with ease. This lets your users write their own arbitrary logic.
Documentation
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,
		}
	}
}