Problem: Vim9: rule for comment after :function is confusing.
Solution: Allow double quoted comment after :function in vim9script.
(closes #6556)
'vim9script',
'function # comment',
])
+ CheckScriptFailure([
+ 'vim9script',
+ 'function " comment',
+ ], 'E129:')
CheckScriptFailure([
'vim9script',
'function# comment',
'func Test() " comment',
'endfunc',
])
- CheckScriptFailure([
+ CheckScriptSuccess([
'vim9script',
'func Test() " comment',
'endfunc',
- ], 'E488:')
+ ])
CheckScriptSuccess([
'def Test() # comment',
if (*p == '\n')
line_arg = p + 1;
else if (*p != NUL
- && !(*p == '"' && !(vim9script || eap->cmdidx == CMD_def))
+ && !(*p == '"' && (!vim9script || eap->cmdidx == CMD_function)
+ && eap->cmdidx != CMD_def)
&& !(*p == '#' && (vim9script || eap->cmdidx == CMD_def))
&& !eap->skip
&& !did_emsg)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1314,
/**/
1313,
/**/