To: vim_dev@googlegroups.com Subject: Patch 8.2.0682 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0682 Problem: Vim9: parsing function argument type can get stuck. Solution: Bail out when not making progress. Files: src/vim9compile.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.0681/src/vim9compile.c 2020-05-02 17:52:38.404147677 +0200 --- src/vim9compile.c 2020-05-02 19:03:19.373703462 +0200 *************** *** 1663,1669 **** --- 1663,1673 ---- ++p; while (*p != ')' && *p != NUL) { + char_u *sp = p; + p = skip_type(p); + if (p == sp) + return p; // syntax error if (*p == ',') p = skipwhite(p + 1); } *** ../vim-8.2.0681/src/testdir/test_vim9_func.vim 2020-05-02 17:52:38.404147677 +0200 --- src/testdir/test_vim9_func.vim 2020-05-02 19:02:21.801880740 +0200 *************** *** 113,118 **** --- 113,119 ---- call CheckDefFailure(['TakesOneArg()'], 'E119:') call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:') call CheckDefFailure(['bufnr(xxx)'], 'E1001:') + call CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:') enddef " Default arg and varargs *** ../vim-8.2.0681/src/version.c 2020-05-02 18:33:20.675870825 +0200 --- src/version.c 2020-05-02 19:04:32.961473318 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 682, /**/ -- Bumper sticker: Honk if you love peace and quiet. /// 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 ///