Patch 9.0.1625
Problem: "super" is not considered a reserved name.
Solution: Add "super" to the list of reserved names. (closes #12515)
Files: src/vim9script.c, src/userfunc.c, src/testdir/test_vim9_assign.vim
*** ../vim-9.0.1624/src/vim9script.c 2023-05-19 19:01:13.292413300 +0100
--- src/vim9script.c 2023-06-10 18:33:48.000962592 +0100
***************
*** 1122,1127 ****
--- 1122,1128 ----
"null_string",
"null_channel",
"null_job",
+ "super",
"this",
NULL
};
*** ../vim-9.0.1624/src/userfunc.c 2023-06-10 16:45:09.402610453 +0100
--- src/userfunc.c 2023-06-10 18:48:08.562316245 +0100
***************
*** 86,97 ****
return arg;
}
! // Vim9 script: cannot use script var name for argument. In function: also
! // check local vars and arguments.
! if (!skip && argtypes != NULL && check_defined(arg, p - arg,
! evalarg == NULL ? NULL : evalarg->eval_cctx,
eap == NULL ? NULL : eap->cstack, TRUE) == FAIL)
! return arg;
if (newargs != NULL && ga_grow(newargs, 1) == FAIL)
return arg;
--- 86,108 ----
return arg;
}
! // Extra checks in Vim9 script.
! if (!skip && argtypes != NULL)
! {
! int c = *p;
! *p = NUL;
! int r = check_reserved_name(arg, FALSE);
! *p = c;
! if (r == FAIL)
! return arg;
!
! // Cannot use script var name for argument. In function: also check
! // local vars and arguments.
! if (check_defined(arg, p - arg,
! evalarg == NULL ? NULL : evalarg->eval_cctx,
eap == NULL ? NULL : eap->cstack, TRUE) == FAIL)
! return arg;
! }
if (newargs != NULL && ga_grow(newargs, 1) == FAIL)
return arg;
*** ../vim-9.0.1624/src/testdir/test_vim9_assign.vim 2023-05-02
16:25:35.630819728 +0100
--- src/testdir/test_vim9_assign.vim 2023-06-10 18:39:54.879665033 +0100
***************
*** 311,316 ****
--- 311,318 ----
for name in ['true',
'false',
+ 'this',
+ 'super',
'null',
'null_blob',
'null_dict',
***************
*** 322,327 ****
--- 324,338 ----
v9.CheckDefExecAndScriptFailure(['var ' .. name .. ' = 0'], 'E1034:')
v9.CheckDefExecAndScriptFailure(['var ' .. name .. ': bool'], 'E1034:')
endfor
+
+ var lines =<< trim END
+ vim9script
+ def Foo(super: bool)
+ echo 'something'
+ enddef
+ defcompile
+ END
+ v9.CheckScriptFailure(lines, 'E1034:')
enddef
def Test_null_values()
***************
*** 1526,1531 ****
--- 1537,1543 ----
v9.CheckDefFailure(['var false = 1'], 'E1034:')
v9.CheckDefFailure(['var null = 1'], 'E1034:')
v9.CheckDefFailure(['var this = 1'], 'E1034:')
+ v9.CheckDefFailure(['var super = 1'], 'E1034:')
v9.CheckDefFailure(['[a; b; c] = g:list'], 'E1001:')
v9.CheckDefFailure(['var [a; b; c] = g:list'], 'E1080:')
*** ../vim-9.0.1624/src/version.c 2023-06-10 16:45:09.406610435 +0100
--- src/version.c 2023-06-10 18:57:51.932860075 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1625,
/**/
--
hundred-and-one symptoms of being an internet addict:
146. You experience ACTUAL physical withdrawal symptoms when away
from your 'puter and the net.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230610180040.1B6BF1C0792%40moolenaar.net.