feat: 添加 do while 与 for-in 语法枚举指令支持

This commit is contained in:
爱特每羊队
2026-06-06 18:18:31 +08:00
parent 04f465d0de
commit 01cd250eda
7 changed files with 70 additions and 1 deletions
+22
View File
@@ -82,6 +82,28 @@ fn hash_statement(stmt: &Statement, h: &mut rustc_hash::FxHasher) {
Statement::ContinueStatement(_) => {
8u8.hash(h);
}
Statement::DoWhileStatement(dw) => {
9u8.hash(h);
hash_statement(&dw.body, h);
hash_expression(&dw.test, h);
}
Statement::ForInStatement(fi) => {
10u8.hash(h);
hash_expression(&fi.right, h);
hash_statement(&fi.body, h);
}
Statement::SwitchStatement(sw) => {
11u8.hash(h);
hash_expression(&sw.discriminant, h);
for case in &sw.cases {
if let Some(test) = &case.test {
hash_expression(test, h);
}
for s in &case.consequent {
hash_statement(s, h);
}
}
}
_ => {
std::mem::discriminant(stmt).hash(h);
}