mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.1200: Vim9: cannot disassemble a lambda function
Problem: Vim9: cannot disassemble a lambda function. Solution: Recognize "<lambda>123" as a function name.
This commit is contained in:
@@ -664,6 +664,19 @@ def Test_disassemble_lambda()
|
|||||||
'\d PCALL (argc 1)\_s*' ..
|
'\d PCALL (argc 1)\_s*' ..
|
||||||
'\d RETURN',
|
'\d RETURN',
|
||||||
instr)
|
instr)
|
||||||
|
|
||||||
|
let name = substitute(instr, '.*\(<lambda>\d\+\).*', '\1', '')
|
||||||
|
instr = execute('disassemble ' .. name)
|
||||||
|
assert_match('<lambda>\d\+\_s*' ..
|
||||||
|
'return "X" .. a .. "X"\_s*' ..
|
||||||
|
'\d PUSHS "X"\_s*' ..
|
||||||
|
'\d LOAD arg\[-1\]\_s*' ..
|
||||||
|
'\d 2STRING stack\[-1\]\_s*' ..
|
||||||
|
'\d CONCAT\_s*' ..
|
||||||
|
'\d PUSHS "X"\_s*' ..
|
||||||
|
'\d CONCAT\_s*' ..
|
||||||
|
'\d RETURN',
|
||||||
|
instr)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def AndOr(arg: any): string
|
def AndOr(arg: any): string
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1200,
|
||||||
/**/
|
/**/
|
||||||
1199,
|
1199,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -2397,7 +2397,14 @@ ex_disassemble(exarg_T *eap)
|
|||||||
int prev_current = 0;
|
int prev_current = 0;
|
||||||
int is_global = FALSE;
|
int is_global = FALSE;
|
||||||
|
|
||||||
fname = trans_function_name(&arg, &is_global, FALSE,
|
if (STRNCMP(arg, "<lambda>", 8) == 0)
|
||||||
|
{
|
||||||
|
arg += 8;
|
||||||
|
(void)getdigits(&arg);
|
||||||
|
fname = vim_strnsave(eap->arg, arg - eap->arg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fname = trans_function_name(&arg, &is_global, FALSE,
|
||||||
TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL);
|
TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD, NULL, NULL);
|
||||||
if (fname == NULL)
|
if (fname == NULL)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user