fix(frontend): 补充不支持语法的警告输出

This commit is contained in:
jing
2026-03-07 22:43:08 +08:00
parent 92f719b7dd
commit 847dc7a5cf
6 changed files with 44 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ class SemaVisitor {
void CheckExpr(const ast::Expr& expr) {
if (auto var = dynamic_cast<const ast::VarExpr*>(&expr)) {
if (!table_.Contains(var->name)) {
throw std::runtime_error("使用了未定义的变量: " + var->name);
throw std::runtime_error("[sema] 使用了未定义的变量: " + var->name);
}
} else if (auto bin = dynamic_cast<const ast::BinaryExpr*>(&expr)) {
CheckExpr(*bin->lhs);