comparison src/vim9script.c @ 20504:7fb80f486aad v8.2.0806

patch 8.2.0806: using "func!" after vim9script gives confusing error Commit: https://github.com/vim/vim/commit/74fae513f8032cfa9e129eedc33454f0bf68668b Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 21 21:50:58 2020 +0200 patch 8.2.0806: using "func!" after vim9script gives confusing error Problem: using "func!" after vim9script gives confusing error. Solution: Give E477. (closes https://github.com/vim/vim/issues/6107)
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 May 2020 22:00:03 +0200
parents 918b9a05cf35
children 489cb75c76b6
comparison
equal deleted inserted replaced
20503:34d4df8db24c 20504:7fb80f486aad
81 line = skipwhite(line); 81 line = skipwhite(line);
82 p = line; 82 p = line;
83 if (checkforcmd(&p, "function", 2) || checkforcmd(&p, "def", 3)) 83 if (checkforcmd(&p, "function", 2) || checkforcmd(&p, "def", 3))
84 { 84 {
85 int lnum_start = SOURCING_LNUM - 1; 85 int lnum_start = SOURCING_LNUM - 1;
86
87 if (*p == '!')
88 {
89 emsg(_(e_nobang));
90 break;
91 }
86 92
87 // Handle :function and :def by calling def_function(). 93 // Handle :function and :def by calling def_function().
88 // It will read upto the matching :endded or :endfunction. 94 // It will read upto the matching :endded or :endfunction.
89 eap->cmdidx = *line == 'f' ? CMD_function : CMD_def; 95 eap->cmdidx = *line == 'f' ? CMD_function : CMD_def;
90 eap->cmd = line; 96 eap->cmd = line;