pub type Ident = String; #[derive(Debug, Clone)] pub enum Statement { Assign { target: Location, source: Box, }, Call { callee: Ident, args: Vec, }, Local { name: Ident, init: Option>, }, } #[derive(Debug, Clone)] pub enum Location { Variable { name: Ident, }, Field { table: Box, index: Box, }, } #[derive(Debug, Clone)] pub enum Expression { Constant(Constant), Variable(Location), Call { callee: Ident, args: Vec, }, Function(Function), } #[derive(Debug, Clone, Default)] pub struct Function { pub name: Option, pub args: Vec, pub body: Vec, pub ret: Option>, } #[derive(Debug, Clone, Default)] pub enum Constant { #[default] Nil, Boolean(bool), Number(i64), String(String), }