Skip to content

Commit

Permalink
patch 9.0.0174: no error for using "#{ comment" in a compiled function
Browse files Browse the repository at this point in the history
Problem:    No error for using "#{ comment" in a compiled function.
Solution:   Make error checking for "#{" consistent. (closes #10855)
  • Loading branch information
brammool committed Aug 8, 2022
1 parent e6a3d81 commit ad6d9cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/testdir/test_vim9_func.vim
Expand Up @@ -74,6 +74,10 @@ def TestCompilingErrorInTry()
delete('Xdir', 'rf')
enddef

def Test_comment_error()
v9.CheckDefFailure(['#{ comment'], 'E1170:')
enddef

def Test_compile_error_in_called_function()
var lines =<< trim END
vim9script
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
174,
/**/
173,
/**/
Expand Down
4 changes: 3 additions & 1 deletion src/vim9compile.c
Expand Up @@ -2899,7 +2899,9 @@ compile_def_function(

if (*ea.cmd == '#')
{
// "#" starts a comment
// "#" starts a comment, but "#{" is an error
if (vim9_bad_comment(ea.cmd))
goto erret;
line = (char_u *)"";
continue;
}
Expand Down

0 comments on commit ad6d9cc

Please sign in to comment.