feat: 实现for循环语句的解析和执行逻辑,更新词法分析器以支持for关键字

This commit is contained in:
0264408
2026-02-11 09:39:06 +08:00
parent 0e0077d96b
commit 5dc55c3476
6 changed files with 71 additions and 0 deletions
+8
View File
@@ -27,6 +27,14 @@ pub enum Stmt {
body: Box<Stmt>,
},
/// for 循环
For {
initializer: Option<Box<Stmt>>,
condition: Option<Expr>,
step: Option<Expr>,
body: Box<Stmt>,
},
/// 函数声明
Function {
name: String,