use crate::ast::expr::Expr; #[derive(Debug, Clone)] pub enum Stmt { /// let x = expr; Let { name: String, initializer: Expr, }, /// 表达式语句:expr; ExprStmt(Expr), /// 代码块:{ ... } Block(Vec), /// if 语句 If { condition: Expr, then_branch: Box, else_branch: Option>, }, /// while 循环 While { condition: Expr, body: Box, }, /// 函数声明 Function { name: String, params: Vec, body: Vec, }, /// return expr?; Return(Option), }