use syntax::{ expr::{ BinaryOp, UnaryOp, Lit, Spanned, }, ty::Type, }; // Typed version of the expression. #[derive(Clone, Debug)] pub enum TExpr<'src> { Lit(Lit<'src>), Ident(&'src str), Unary { op: UnaryOp, expr: Spanned>, ret_ty: Type, }, Binary { op: BinaryOp, lhs: Spanned>, rhs: Spanned>, ret_ty: Type, }, Lambda { params: Vec<(&'src str, Type)>, body: Spanned>, ret_ty: Type, }, Call { func: Spanned>, args: Vec>, }, If { cond: Spanned>, t: Spanned>, f: Spanned>, br_ty: Type, }, Let { name: &'src str, ty: Type, value: Spanned>, body: Spanned>, }, Define { name: &'src str, ty: Type, value: Spanned>, }, Block { exprs: Vec>, void: bool, ret_ty: Type, }, }