diff src/vim9compile.c @ 24188:c20e763bc73c v8.2.2635

patch 8.2.2635: Vim9: cannot define an inline function Commit: https://github.com/vim/vim/commit/7a6eaa06f98cef61d2131c25b4b47b8262cb8f59 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 21 20:53:29 2021 +0100 patch 8.2.2635: Vim9: cannot define an inline function Problem: Vim9: cannot define an inline function. Solution: Make an inline function mostly work.
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Mar 2021 21:00:05 +0100
parents 93e69703a290
children 5f3a2d31c48d
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3171,7 +3171,7 @@ compile_list(char_u **arg, cctx_T *cctx,
 
 /*
  * Parse a lambda: "(arg, arg) => expr"
- * "*arg" points to the '{'.
+ * "*arg" points to the '('.
  * Returns OK/FAIL when a lambda is recognized, NOTDONE if it's not a lambda.
  */
     static int
@@ -5126,6 +5126,13 @@ exarg_getline(
     }
 }
 
+    void
+fill_exarg_from_cctx(exarg_T *eap, cctx_T *cctx)
+{
+    eap->getline = exarg_getline;
+    eap->cookie = cctx;
+}
+
 /*
  * Compile a nested :def command.
  */
@@ -5176,9 +5183,8 @@ compile_nested_function(exarg_T *eap, cc
 	return NULL;
 
     eap->arg = name_end;
-    eap->getline = exarg_getline;
-    eap->cookie = cctx;
-    eap->skip = cctx->ctx_skip == SKIP_YES;
+    fill_exarg_from_cctx(eap, cctx);
+
     eap->forceit = FALSE;
     lambda_name = vim_strsave(get_lambda_name());
     if (lambda_name == NULL)