To: vim_dev@googlegroups.com Subject: Patch 8.2.3185 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3185 Problem: Vim9: start of inline function found in comment line. Solution: Do not check for inline function in comment line. (closes #8589) Files: src/userfunc.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.3184/src/userfunc.c 2021-07-15 23:44:49.532673603 +0200 --- src/userfunc.c 2021-07-19 21:02:28.624039689 +0200 *************** *** 866,891 **** } } ! // Check for nested inline function. ! end = p + STRLEN(p) - 1; ! while (end > p && VIM_ISWHITE(*end)) ! --end; ! if (end > p && *end == '{') { ! --end; while (end > p && VIM_ISWHITE(*end)) --end; ! if (end > p + 2 && end[-1] == '=' && end[0] == '>') { ! // found trailing "=> {", start of an inline function ! if (nesting == MAX_FUNC_NESTING - 1) ! emsg(_(e_function_nesting_too_deep)); ! else { ! ++nesting; ! nesting_def[nesting] = TRUE; ! nesting_inline[nesting] = TRUE; ! indent += 2; } } } --- 866,894 ---- } } ! if (nesting_def[nesting] ? *p != '#' : *p != '"') { ! // Not a comment line: check for nested inline function. ! end = p + STRLEN(p) - 1; while (end > p && VIM_ISWHITE(*end)) --end; ! if (end > p && *end == '{') { ! --end; ! while (end > p && VIM_ISWHITE(*end)) ! --end; ! if (end > p + 2 && end[-1] == '=' && end[0] == '>') { ! // found trailing "=> {", start of an inline function ! if (nesting == MAX_FUNC_NESTING - 1) ! emsg(_(e_function_nesting_too_deep)); ! else ! { ! ++nesting; ! nesting_def[nesting] = TRUE; ! nesting_inline[nesting] = TRUE; ! indent += 2; ! } } } } *** ../vim-8.2.3184/src/testdir/test_vim9_expr.vim 2021-07-18 14:43:39.791940898 +0200 --- src/testdir/test_vim9_expr.vim 2021-07-19 21:01:46.760111751 +0200 *************** *** 2075,2080 **** --- 2075,2084 ---- }) assert_equal(['no', 'yes', 'no'], dll) + # ignored_inline(0, (_) => { + # echo 'body' + # }) + sandbox var Safe = (nr: number): number => { return nr + 7 } *** ../vim-8.2.3184/src/version.c 2021-07-19 20:07:16.701295618 +0200 --- src/version.c 2021-07-19 21:04:12.531860887 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3185, /**/ -- hundred-and-one symptoms of being an internet addict: 186. You overstay in the office so you can have more time surfing the net. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///