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:
@@ -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)
|
||||
|
@@ -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"',
|
||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
586,
|
||||
/**/
|
||||
585,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user