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

9
examples/loop.ast Normal file
View File

@@ -0,0 +1,9 @@
let i = 0;
while(i < 10) {
print(i);
i = i + 1;
}
for (let i = 0; i < 10; i = i + 1) {
print(i)
}