0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.1.0314: Vim9: Can define a class in a function

Problem:  Vim9: Can define a class in a function
          (Doug Kearns)
Solution: Give an error for a class defined in a function,
          slightly reword some public error messages
          (Yegappan Lakshmanan)

fixes: #13184
fixes: #13326
closes: #14537

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2024-04-13 17:58:09 +02:00
committed by Christian Brabandt
parent 122d068585
commit c51578fed8
8 changed files with 43 additions and 17 deletions

View File

@@ -2080,6 +2080,12 @@ early_ret:
has_public = TRUE;
p = skipwhite(line + 6);
if (STRNCMP(p, "def", 3) == 0)
{
emsg(_(e_public_keyword_not_supported_for_method));
break;
}
if (STRNCMP(p, "var", 3) != 0 && STRNCMP(p, "static", 6) != 0
&& STRNCMP(p, "final", 5) != 0 && STRNCMP(p, "const", 5) != 0)
{