diff src/vim9.h @ 23927:5e5780e3f75d v8.2.2506

patch 8.2.2506: Vim9: :continue does not work correctly in a :try block Commit: https://github.com/vim/vim/commit/c150c09ec4f97636c6339f5687fdaa9f665095d2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 13 15:02:46 2021 +0100 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 https://github.com/vim/vim/issues/7827)
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Feb 2021 15:15:03 +0100
parents 5a524e16570b
children ba79ceac82ec
line wrap: on
line diff
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -100,6 +100,7 @@ typedef enum {
     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 @@ typedef struct {
 // 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 @@ struct isn_S {
 	jump_T		    jump;
 	forloop_T	    forloop;
 	try_T		    try;
+	trycont_T	    trycont;
 	cbfunc_T	    bfunc;
 	cdfunc_T	    dfunc;
 	cpfunc_T	    pfunc;