To: vim_dev@googlegroups.com Subject: Patch 8.2.1246 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1246 Problem: Vim9: comment after assignment doesn't work. Solution: Skip over white space. (closes #6481) Files: src/vim9compile.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.1245/src/vim9compile.c 2020-07-19 15:49:45.732131023 +0200 --- src/vim9compile.c 2020-07-19 17:12:31.188145264 +0200 *************** *** 5706,5712 **** goto theend; } ! ret = end; theend: vim_free(name); --- 5706,5712 ---- goto theend; } ! ret = skipwhite(end); theend: vim_free(name); *** ../vim-8.2.1245/src/testdir/test_vim9_script.vim 2020-07-18 18:12:57.758647551 +0200 --- src/testdir/test_vim9_script.vim 2020-07-19 17:15:37.099225917 +0200 *************** *** 29,35 **** call CheckDefFailure(['let x:string = "x"'], 'E1069:') call CheckDefFailure(['let a:string = "x"'], 'E1069:') ! let a: number = 6 assert_equal(6, a) if has('channel') --- 29,35 ---- call CheckDefFailure(['let x:string = "x"'], 'E1069:') call CheckDefFailure(['let a:string = "x"'], 'E1069:') ! let a: number = 6 #comment assert_equal(6, a) if has('channel') *************** *** 44,50 **** let Funky2: func = function('len') let Party2: func = funcref('g:Test_syntax') ! g:newvar = 'new' assert_equal('new', g:newvar) assert_equal('yes', g:existing) --- 44,50 ---- let Funky2: func = function('len') let Party2: func = funcref('g:Test_syntax') ! g:newvar = 'new' #comment assert_equal('new', g:newvar) assert_equal('yes', g:existing) *************** *** 821,826 **** --- 821,842 ---- set errorformat& enddef + def Test_list_vimscript() + # checks line continuation and comments + let lines =<< trim END + vim9script + let mylist = [ + 'one', + # comment + 'two', # empty line follows + + 'three', + ] + assert_equal(['one', 'two', 'three'], mylist) + END + CheckScriptSuccess(lines) + enddef + if has('channel') let someJob = test_null_job() *** ../vim-8.2.1245/src/version.c 2020-07-19 16:32:06.085674254 +0200 --- src/version.c 2020-07-19 17:13:51.019738988 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1246, /**/ -- Never overestimate a man's ability to underestimate a woman. /// 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 ///