diff options
Diffstat (limited to 'src/parser_pos.cpp')
| -rw-r--r-- | src/parser_pos.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parser_pos.cpp b/src/parser_pos.cpp index 3d2e8f27d..f49c40f16 100644 --- a/src/parser_pos.cpp +++ b/src/parser_pos.cpp @@ -52,6 +52,7 @@ gb_internal Token ast_token(Ast *node) { case Ast_TernaryWhenExpr: return ast_token(node->TernaryWhenExpr.x); case Ast_OrElseExpr: return ast_token(node->OrElseExpr.x); case Ast_OrReturnExpr: return ast_token(node->OrReturnExpr.expr); + case Ast_OrBranchExpr: return ast_token(node->OrBranchExpr.expr); case Ast_TypeAssertion: return ast_token(node->TypeAssertion.expr); case Ast_TypeCast: return node->TypeCast.token; case Ast_AutoCast: return node->AutoCast.token; @@ -195,6 +196,11 @@ Token ast_end_token(Ast *node) { case Ast_TernaryWhenExpr: return ast_end_token(node->TernaryWhenExpr.y); case Ast_OrElseExpr: return ast_end_token(node->OrElseExpr.y); case Ast_OrReturnExpr: return node->OrReturnExpr.token; + case Ast_OrBranchExpr: + if (node->OrBranchExpr.label != nullptr) { + return ast_end_token(node->OrBranchExpr.label); + } + return node->OrBranchExpr.token; case Ast_TypeAssertion: return ast_end_token(node->TypeAssertion.type); case Ast_TypeCast: return ast_end_token(node->TypeCast.expr); case Ast_AutoCast: return ast_end_token(node->AutoCast.expr); |