• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionb66a2e046c2e4c53ba71febbae205433c109b3f5 (tree)
Zeit2020-09-22 05:15:03
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.1723: Vim9: Variable argument name cannot start with underscore

Commit: https://github.com/vim/vim/commit/280227270c1c54794a6d88a305fac56d4b0c92a5
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 21 22:02:49 2020 +0200

patch 8.2.1723: Vim9: Variable argument name cannot start with underscore
Problem: Vim9: Variable argument name cannot start with underscore.
Solution: Use eval_isnamec1(). (closes https://github.com/vim/vim/issues/6988)

Ändern Zusammenfassung

Diff

diff -r 267f3a1c5105 -r b66a2e046c2e src/testdir/test_vim9_func.vim
--- a/src/testdir/test_vim9_func.vim Mon Sep 21 22:00:04 2020 +0200
+++ b/src/testdir/test_vim9_func.vim Mon Sep 21 22:15:03 2020 +0200
@@ -374,6 +374,15 @@
374374
375375 lines =<< trim END
376376 vim9script
377+ def Func(..._l: list<string>)
378+ echo _l
379+ enddef
380+ Func('a', 'b', 'c')
381+ END
382+ CheckScriptSuccess(lines)
383+
384+ lines =<< trim END
385+ vim9script
377386 def Func(...l: list<string>)
378387 echo l
379388 enddef
diff -r 267f3a1c5105 -r b66a2e046c2e src/userfunc.c
--- a/src/userfunc.c Mon Sep 21 22:00:04 2020 +0200
+++ b/src/userfunc.c Mon Sep 21 22:15:03 2020 +0200
@@ -211,7 +211,7 @@
211211 if (argtypes != NULL)
212212 {
213213 // ...name: list<type>
214- if (!ASCII_ISALPHA(*p))
214+ if (!eval_isnamec1(*p))
215215 {
216216 emsg(_(e_missing_name_after_dots));
217217 break;
diff -r 267f3a1c5105 -r b66a2e046c2e src/version.c
--- a/src/version.c Mon Sep 21 22:00:04 2020 +0200
+++ b/src/version.c Mon Sep 21 22:15:03 2020 +0200
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 1723,
755+/**/
754756 1722,
755757 /**/
756758 1721,
Show on old repository browser