patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Problem: Vim9: :continue does not work correctly in a :try block
Solution: Add the TRYCLEANUP instruction. (closes #7827)
diff --git a/src/vim9.h b/src/vim9.h
index 82fdfe6..c2a3916 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -100,6 +100,7 @@
ISN_PUSHEXC, // push v:exception
ISN_CATCH, // drop v:exception
ISN_ENDTRY, // take entry off from ec_trystack
+ ISN_TRYCONT, // handle :continue inside a :try statement
// more expression operations
ISN_ADDLIST, // add two lists
@@ -209,9 +210,15 @@
// arguments to ISN_TRY
typedef struct {
int try_catch; // position to jump to on throw
- int try_finally; // position to jump to for return
+ int try_finally; // :finally or :endtry position to jump to
} try_T;
+// arguments to ISN_TRYCONT
+typedef struct {
+ int tct_levels; // number of nested try statements
+ int tct_where; // position to jump to, WHILE or FOR
+} trycont_T;
+
// arguments to ISN_ECHO
typedef struct {
int echo_with_white; // :echo instead of :echon
@@ -333,6 +340,7 @@
jump_T jump;
forloop_T forloop;
try_T try;
+ trycont_T trycont;
cbfunc_T bfunc;
cdfunc_T dfunc;
cpfunc_T pfunc;