diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-13 18:18:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-13 18:18:00 +0200 |
commit | bfd65589d9b6bd5fd2c8ee768d1427469bd61ead (patch) | |
tree | 250860c3bc95a8e7a7e855e73ceb00b460310f8a /src/testdir/test_vim9_disassemble.vim | |
parent | 7177da9dd4d9a521c6141c6fbf7e9a4d6296ab05 (diff) | |
download | vim-git-bfd65589d9b6bd5fd2c8ee768d1427469bd61ead.tar.gz |
patch 8.2.1200: Vim9: cannot disassemble a lambda functionv8.2.1200
Problem: Vim9: cannot disassemble a lambda function.
Solution: Recognize "<lambda>123" as a function name.
Diffstat (limited to 'src/testdir/test_vim9_disassemble.vim')
-rw-r--r-- | src/testdir/test_vim9_disassemble.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 6cde5dda7..f1f943ecb 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -664,6 +664,19 @@ def Test_disassemble_lambda() '\d PCALL (argc 1)\_s*' .. '\d RETURN', 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 def AndOr(arg: any): string |