fix(frontend): 补充不支持语法的警告输出
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user