From: Bram Moolenaar Date: Thu, 16 Apr 2020 20:54:32 +0000 (+0200) Subject: patch 8.2.0586: Vim9: # comment not sufficiently tested X-Git-Tag: v8.2.0586 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a8d9f2ed8c0079732e35d72656a000641353b94;p=vim patch 8.2.0586: Vim9: # comment not sufficiently tested Problem: Vim9: # comment not sufficiently tested Solution: Check for preceding white space. --- diff --git a/src/eval.c b/src/eval.c index af228965f..1840f7420 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6143,7 +6143,7 @@ ex_execute(exarg_T *eap) if (eap->skip) ++emsg_skip; - while (*arg != NUL && *arg != '|' && *arg != '\n') + while (!ends_excmd2(eap->cmd, arg) || *arg == '"') { ret = eval1_emsg(&arg, &rettv, !eap->skip); if (ret == FAIL) diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index a96910e83..58363baca 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1025,6 +1025,20 @@ def Test_vim9_comment() ':# something', ], 'E488:') + { # block start + } # block end + CheckDefFailure([ + '{# comment', + ], 'E488:') + CheckDefFailure([ + '{', + '}# comment', + ], 'E488:') + + echo "yes" # comment + CheckDefFailure([ + 'echo "yes"# comment', + ], 'E488:') CheckScriptSuccess([ 'vim9script', 'echo "yes" # something', @@ -1041,6 +1055,29 @@ def Test_vim9_comment() 'echo "yes" # something', ], 'E121:') + exe "echo" # comment + CheckDefFailure([ + 'exe "echo"# comment', + ], 'E488:') + CheckScriptSuccess([ + 'vim9script', + 'exe "echo" # something', + ]) + CheckScriptFailure([ + 'vim9script', + 'exe "echo"# something', + ], 'E121:') + CheckDefFailure([ + 'exe # comment', + ], 'E1015:') + CheckScriptFailure([ + 'vim9script', + 'exe# something', + ], 'E121:') + CheckScriptFailure([ + 'exe "echo" # something', + ], 'E121:') + CheckDefFailure([ 'try# comment', 'echo "yes"', diff --git a/src/version.c b/src/version.c index ca8d71c1f..5ff481f34 100644 --- a/src/version.c +++ b/src/version.c @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 586, /**/ 585, /**/