diff src/vim9compile.c @ 27593:8c7836f8668d v8.2.4323

patch 8.2.4323: Vim9: nested function name can start with "_" Commit: https://github.com/vim/vim/commit/f681cfb90b972cb347b3d707c87e48f8accd0e2a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 7 20:30:57 2022 +0000 patch 8.2.4323: Vim9: nested function name can start with "_" Problem: Vim9: nested function name can start with "_". Solution: Use same rule for function name for nested functions. (closes #9713)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Feb 2022 21:45:02 +0100
parents 9f70df0b2967
children d504745607bc
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -886,6 +886,11 @@ compile_nested_function(exarg_T *eap, cc
     }
     if (check_defined(name_start, name_end - name_start, cctx, FALSE) == FAIL)
 	return NULL;
+    if (!ASCII_ISUPPER(is_global ? name_start[2] : name_start[0]))
+    {
+	semsg(_(e_function_name_must_start_with_capital_or_s_str), name_start);
+	return NULL;
+    }
 
     eap->arg = name_end;
     fill_exarg_from_cctx(eap, cctx);