diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-21 22:02:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-21 22:02:49 +0200 |
commit | 280227270c1c54794a6d88a305fac56d4b0c92a5 (patch) | |
tree | e44a89ce8ec294e86bfd9efb28b7da2a637a7cda | |
parent | dbd759309b4b6abea96b18d61770e100cf4264b5 (diff) |
patch 8.2.1723: Vim9: Variable argument name cannot start with underscorev8.2.1723
Problem: Vim9: Variable argument name cannot start with underscore.
Solution: Use eval_isnamec1(). (closes #6988)
-rw-r--r-- | src/testdir/test_vim9_func.vim | 9 | ||||
-rw-r--r-- | src/userfunc.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 40516509cb..e6f40cca6f 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -374,6 +374,15 @@ def Test_call_def_varargs() lines =<< trim END vim9script + def Func(..._l: list<string>) + echo _l + enddef + Func('a', 'b', 'c') + END + CheckScriptSuccess(lines) + + lines =<< trim END + vim9script def Func(...l: list<string>) echo l enddef diff --git a/src/userfunc.c b/src/userfunc.c index be2a18c0d6..eb9dadff88 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -211,7 +211,7 @@ get_function_args( if (argtypes != NULL) { // ...name: list<type> - if (!ASCII_ISALPHA(*p)) + if (!eval_isnamec1(*p)) { emsg(_(e_missing_name_after_dots)); break; diff --git a/src/version.c b/src/version.c index 7cc9e7bebd..b6cb4773f2 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1723, +/**/ 1722, /**/ 1721, |