feat: 添加break和continue语句的支持,更新解析器、解释器和词法分析器以处理相关语法

This commit is contained in:
0264408
2026-06-10 17:37:12 +08:00
parent dd3f18da6f
commit ae3060708d
7 changed files with 109 additions and 21 deletions
+7
View File
@@ -24,6 +24,13 @@ pub enum Value {
NativeFunction(NativeFn),
}
pub enum Signal {
None, // 正常执行
Return(Value), // return 语句携带的返回值
Break, // break 信号
Continue, // continue 信号
}
impl std::fmt::Debug for Value {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {