To: vim_dev@googlegroups.com Subject: Patch 8.2.0586 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0586 Problem: Vim9: # comment not sufficiently tested Solution: Check for preceding white space. Files: src/eval.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.0585/src/eval.c 2020-04-16 22:10:42.656733692 +0200 --- src/eval.c 2020-04-16 22:23:37.875288577 +0200 *************** *** 6143,6149 **** if (eap->skip) ++emsg_skip; ! while (*arg != NUL && *arg != '|' && *arg != '\n') { ret = eval1_emsg(&arg, &rettv, !eap->skip); if (ret == FAIL) --- 6143,6149 ---- if (eap->skip) ++emsg_skip; ! while (!ends_excmd2(eap->cmd, arg) || *arg == '"') { ret = eval1_emsg(&arg, &rettv, !eap->skip); if (ret == FAIL) *** ../vim-8.2.0585/src/testdir/test_vim9_script.vim 2020-04-16 22:10:42.660733681 +0200 --- src/testdir/test_vim9_script.vim 2020-04-16 22:30:49.346361628 +0200 *************** *** 1025,1030 **** --- 1025,1044 ---- ':# 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,1046 **** --- 1055,1083 ---- '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"', *** ../vim-8.2.0585/src/version.c 2020-04-16 22:10:42.660733681 +0200 --- src/version.c 2020-04-16 22:53:31.031241764 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 586, /**/ -- It is too bad that the speed of light hasn't kept pace with the changes in CPU speed and network bandwidth. -- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///