use crate::trans::ty::*; use crate::read::parse::Spanned; #[derive(Clone, Debug)] pub enum PUnaryOp { Neg, Not, } #[derive(Clone, Debug)] pub enum PBinaryOp { Add, Sub, Mul, Div, Mod, Eq, Neq, Lt, Gt, Lte, Gte, And, Or, } #[derive(Clone, Debug)] pub enum PLiteral { Num(i64), Str(String), Bool(bool), Unit } #[derive(Clone, Debug)] pub enum PExpr { Error, Lit(PLiteral), Sym(String), Vec(Vec>), Unary(Spanned, Box>), Binary(Spanned, Box>, Box>), Call(Box>, Vec>), Lambda { args: Vec<(String, Type)>, body: Box>, }, Let { vars: Vec<(String, Type, Spanned)>, body: Option>>, }, If { cond: Box>, t: Box>, f: Box>, }, Block(Vec>), Return(Box>), } #[derive(Clone, Debug)] pub enum PStmt { Expr(Spanned), Func { name: String, args: Vec<(String, Type)>, ret: Type, body: Box>, }, }