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

patch 8.2.0586: Vim9: # comment not sufficiently tested

Problem:    Vim9: # comment not sufficiently tested
Solution:   Check for preceding white space.
This commit is contained in:
Bram Moolenaar
2020-04-16 22:54:32 +02:00
parent 7a09224583
commit 4a8d9f2ed8
3 changed files with 40 additions and 1 deletions

View File

@@ -6143,7 +6143,7 @@ ex_execute(exarg_T *eap)
if (eap->skip) if (eap->skip)
++emsg_skip; ++emsg_skip;
while (*arg != NUL && *arg != '|' && *arg != '\n') while (!ends_excmd2(eap->cmd, arg) || *arg == '"')
{ {
ret = eval1_emsg(&arg, &rettv, !eap->skip); ret = eval1_emsg(&arg, &rettv, !eap->skip);
if (ret == FAIL) if (ret == FAIL)

View File

@@ -1025,6 +1025,20 @@ def Test_vim9_comment()
':# something', ':# something',
], 'E488:') ], 'E488:')
{ # block start
} # block end
CheckDefFailure([
'{# comment',
], 'E488:')
CheckDefFailure([
'{',
'}# comment',
], 'E488:')
echo "yes" # comment
CheckDefFailure([
'echo "yes"# comment',
], 'E488:')
CheckScriptSuccess([ CheckScriptSuccess([
'vim9script', 'vim9script',
'echo "yes" # something', 'echo "yes" # something',
@@ -1041,6 +1055,29 @@ def Test_vim9_comment()
'echo "yes" # something', 'echo "yes" # something',
], 'E121:') ], '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([ CheckDefFailure([
'try# comment', 'try# comment',
'echo "yes"', 'echo "yes"',

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
586,
/**/ /**/
585, 585,
/**/ /**/