diff options
Diffstat (limited to 'src/apply-names.cc')
-rw-r--r-- | src/apply-names.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/apply-names.cc b/src/apply-names.cc index 6d531be2..c8516c8c 100644 --- a/src/apply-names.cc +++ b/src/apply-names.cc @@ -73,6 +73,8 @@ class NameApplier : public ExprVisitor::DelegateNop { Result OnStoreExpr(StoreExpr*) override; Result BeginTryExpr(TryExpr*) override; Result EndTryExpr(TryExpr*) override; + Result BeginTryTableExpr(TryTableExpr*) override; + Result EndTryTableExpr(TryTableExpr*) override; Result OnCatchExpr(TryExpr*, Catch*) override; Result OnDelegateExpr(TryExpr*) override; Result OnThrowExpr(ThrowExpr*) override; @@ -369,6 +371,23 @@ Result NameApplier::EndTryExpr(TryExpr*) { return Result::Ok; } +Result NameApplier::BeginTryTableExpr(TryTableExpr* expr) { + for (TableCatch& catch_ : expr->catches) { + if (!catch_.IsCatchAll()) { + CHECK_RESULT(UseNameForTagVar(&catch_.tag)); + } + std::string_view label = FindLabelByVar(&catch_.target); + UseNameForVar(label, &catch_.target); + } + PushLabel(expr->block.label); + return Result::Ok; +} + +Result NameApplier::EndTryTableExpr(TryTableExpr*) { + PopLabel(); + return Result::Ok; +} + Result NameApplier::OnCatchExpr(TryExpr*, Catch* expr) { if (!expr->IsCatchAll()) { CHECK_RESULT(UseNameForTagVar(&expr->var)); |