comparison src/vim9compile.c @ 23344:1f37fd20f851 v8.2.2215

patch 8.2.2215: Vim9: not recognized in global command Commit: https://github.com/vim/vim/commit/56ce9ea3ea46529cac2fdf3151abfa0e1ae49bad Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 25 18:35:29 2020 +0100 patch 8.2.2215: Vim9: not recognized in global command Problem: Vim9: not recognized in global command. Solution: Skip over pattern. (issue https://github.com/vim/vim/issues/7541)
author Bram Moolenaar <Bram@vim.org>
date Fri, 25 Dec 2020 18:45:03 +0100
parents 4b4f695e9cd1
children 2060f53b7c17
comparison
equal deleted inserted replaced
23343:2085a9327b52 23344:1f37fd20f851
2945 ppconst->pp_is_const = is_all_const; 2945 ppconst->pp_is_const = is_all_const;
2946 return generate_NEWLIST(cctx, count); 2946 return generate_NEWLIST(cctx, count);
2947 } 2947 }
2948 2948
2949 /* 2949 /*
2950 * parse a lambda: {arg, arg -> expr} 2950 * parse a lambda: "{arg, arg -> expr}" or "(arg, arg) => expr"
2951 * "*arg" points to the '{'. 2951 * "*arg" points to the '{'.
2952 */ 2952 */
2953 static int 2953 static int
2954 compile_lambda(char_u **arg, cctx_T *cctx) 2954 compile_lambda(char_u **arg, cctx_T *cctx)
2955 { 2955 {
7311 // expand filename in "syntax include [@group] filename" 7311 // expand filename in "syntax include [@group] filename"
7312 has_expr = TRUE; 7312 has_expr = TRUE;
7313 eap->arg = skipwhite(eap->arg + 7); 7313 eap->arg = skipwhite(eap->arg + 7);
7314 if (*eap->arg == '@') 7314 if (*eap->arg == '@')
7315 eap->arg = skiptowhite(eap->arg); 7315 eap->arg = skiptowhite(eap->arg);
7316 }
7317
7318 if ((eap->cmdidx == CMD_global || eap->cmdidx == CMD_vglobal)
7319 && STRLEN(eap->arg) > 4)
7320 {
7321 int delim = *eap->arg;
7322
7323 p = skip_regexp_ex(eap->arg + 1, delim, TRUE, NULL, NULL);
7324 if (*p == delim)
7325 {
7326 eap->arg = p + 1;
7327 has_expr = TRUE;
7328 }
7316 } 7329 }
7317 7330
7318 if (has_expr && (p = (char_u *)strstr((char *)eap->arg, "`=")) != NULL) 7331 if (has_expr && (p = (char_u *)strstr((char *)eap->arg, "`=")) != NULL)
7319 { 7332 {
7320 int count = 0; 7333 int count = 0;