summaryrefslogtreecommitdiff
path: root/src/resolve-names.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve-names.cc')
-rw-r--r--src/resolve-names.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/resolve-names.cc b/src/resolve-names.cc
index 9fc8e443..67fc44e9 100644
--- a/src/resolve-names.cc
+++ b/src/resolve-names.cc
@@ -75,6 +75,8 @@ class NameResolver : public ExprVisitor::DelegateNop {
Result OnStoreExpr(StoreExpr*) override;
Result BeginTryExpr(TryExpr*) override;
Result EndTryExpr(TryExpr*) override;
+ Result BeginTryTableExpr(TryTableExpr*) override;
+ Result EndTryTableExpr(TryTableExpr*) override;
Result OnThrowExpr(ThrowExpr*) override;
Result OnRethrowExpr(RethrowExpr*) override;
Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;
@@ -442,6 +444,23 @@ Result NameResolver::EndTryExpr(TryExpr*) {
return Result::Ok;
}
+Result NameResolver::BeginTryTableExpr(TryTableExpr* expr) {
+ for (TableCatch& catch_ : expr->catches) {
+ if (!catch_.IsCatchAll()) {
+ ResolveTagVar(&catch_.tag);
+ }
+ ResolveLabelVar(&catch_.target);
+ }
+ PushLabel(expr->block.label);
+ ResolveBlockDeclarationVar(&expr->block.decl);
+ return Result::Ok;
+}
+
+Result NameResolver::EndTryTableExpr(TryTableExpr*) {
+ PopLabel();
+ return Result::Ok;
+}
+
Result NameResolver::OnCatchExpr(TryExpr*, Catch* catch_) {
if (!catch_->IsCatchAll()) {
ResolveTagVar(&catch_->var);