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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202107191904.16JJ4mVG3095781%40masaka.moolenaar.net.