diff options
Diffstat (limited to 'src/expr-visitor.cc')
-rw-r--r-- | src/expr-visitor.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/expr-visitor.cc b/src/expr-visitor.cc index 05cd2798..217d45cc 100644 --- a/src/expr-visitor.cc +++ b/src/expr-visitor.cc @@ -90,6 +90,18 @@ Result ExprVisitor::VisitExpr(Expr* root_expr) { break; } + case State::TryTable: { + auto try_table_expr = cast<TryTableExpr>(expr); + auto& iter = expr_iter_stack_.back(); + if (iter != try_table_expr->block.exprs.end()) { + PushDefault(&*iter++); + } else { + CHECK_RESULT(delegate_->EndTryTableExpr(try_table_expr)); + PopExprlist(); + } + break; + } + case State::Try: { auto try_expr = cast<TryExpr>(expr); auto& iter = expr_iter_stack_.back(); @@ -386,6 +398,17 @@ Result ExprVisitor::HandleDefaultState(Expr* expr) { CHECK_RESULT(delegate_->OnThrowExpr(cast<ThrowExpr>(expr))); break; + case ExprType::ThrowRef: + CHECK_RESULT(delegate_->OnThrowRefExpr(cast<ThrowRefExpr>(expr))); + break; + + case ExprType::TryTable: { + auto try_table_expr = cast<TryTableExpr>(expr); + CHECK_RESULT(delegate_->BeginTryTableExpr(try_table_expr)); + PushExprlist(State::TryTable, expr, try_table_expr->block.exprs); + break; + } + case ExprType::Try: { auto try_expr = cast<TryExpr>(expr); CHECK_RESULT(delegate_->BeginTryExpr(try_expr)); |