To: vim_dev@googlegroups.com Subject: Patch 8.2.0758 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0758 Problem: Vim9: no test for STORELIST and STOREDICT. Solution: Add a test. Make matches stricter. Files: src/testdir/test_vim9_disassemble.vim *** ../vim-8.2.0757/src/testdir/test_vim9_disassemble.vim 2020-05-15 19:21:28.349090291 +0200 --- src/testdir/test_vim9_disassemble.vim 2020-05-15 20:52:12.069668479 +0200 *************** *** 154,159 **** --- 154,190 ---- res) enddef + def s:ScriptFuncStoreMember() + let locallist: list = [] + locallist[0] = 123 + let localdict: dict = {} + localdict["a"] = 456 + enddef + + def Test_disassemble_store_member() + let res = execute('disass s:ScriptFuncStoreMember') + assert_match('\d*_ScriptFuncStoreMember\_s*' .. + 'let locallist: list = []\_s*' .. + '\d NEWLIST size 0\_s*' .. + '\d STORE $0\_s*' .. + 'locallist\[0\] = 123\_s*' .. + '\d PUSHNR 123\_s*' .. + '\d PUSHNR 0\_s*' .. + '\d LOAD $0\_s*' .. + '\d STORELIST\_s*' .. + 'let localdict: dict = {}\_s*' .. + '\d NEWDICT size 0\_s*' .. + '\d STORE $1\_s*' .. + 'localdict\["a"\] = 456\_s*' .. + '\d\+ PUSHNR 456\_s*' .. + '\d\+ PUSHS "a"\_s*' .. + '\d\+ LOAD $1\_s*' .. + '\d\+ STOREDICT\_s*' .. + '\d\+ PUSHNR 0\_s*' .. + '\d\+ RETURN', + res) + enddef + def s:ScriptFuncUnlet() g:somevar = "value" unlet g:somevar *************** *** 163,208 **** def Test_disassemble_unlet() let res = execute('disass s:ScriptFuncUnlet') ! assert_match('\d*_ScriptFuncUnlet.*' .. ! 'g:somevar = "value".*' .. ! '\d PUSHS "value".*' .. ! '\d STOREG g:somevar.*' .. ! 'unlet g:somevar.*' .. ! '\d UNLET g:somevar.*' .. ! 'unlet! g:somevar.*' .. ! '\d UNLET! g:somevar.*' .. ! 'unlet $SOMEVAR.*' .. ! '\d UNLETENV $SOMEVAR.*', res) enddef def s:ScriptFuncTry() try ! echo 'yes' catch /fail/ ! echo 'no' finally ! throw 'end' endtry enddef def Test_disassemble_try() let res = execute('disass s:ScriptFuncTry') ! assert_match('\d*_ScriptFuncTry.*' .. ! 'try.*' .. ! 'TRY catch -> \d\+, finally -> \d\+.*' .. ! 'catch /fail/.*' .. ! ' JUMP -> \d\+.*' .. ! ' PUSH v:exception.*' .. ! ' PUSHS "fail".*' .. ! ' COMPARESTRING =\~.*' .. ! ' JUMP_IF_FALSE -> \d\+.*' .. ! ' CATCH.*' .. ! 'finally.*' .. ! ' PUSHS "end".*' .. ! ' THROW.*' .. ! 'endtry.*' .. ! ' ENDTRY.*', res) enddef --- 194,246 ---- def Test_disassemble_unlet() let res = execute('disass s:ScriptFuncUnlet') ! assert_match('\d*_ScriptFuncUnlet\_s*' .. ! 'g:somevar = "value"\_s*' .. ! '\d PUSHS "value"\_s*' .. ! '\d STOREG g:somevar\_s*' .. ! 'unlet g:somevar\_s*' .. ! '\d UNLET g:somevar\_s*' .. ! 'unlet! g:somevar\_s*' .. ! '\d UNLET! g:somevar\_s*' .. ! 'unlet $SOMEVAR\_s*' .. ! '\d UNLETENV $SOMEVAR\_s*', res) enddef def s:ScriptFuncTry() try ! echo "yes" catch /fail/ ! echo "no" finally ! throw "end" endtry enddef def Test_disassemble_try() let res = execute('disass s:ScriptFuncTry') ! assert_match('\d*_ScriptFuncTry\_s*' .. ! 'try\_s*' .. ! '\d TRY catch -> \d\+, finally -> \d\+\_s*' .. ! 'echo "yes"\_s*' .. ! '\d PUSHS "yes"\_s*' .. ! '\d ECHO 1\_s*' .. ! 'catch /fail/\_s*' .. ! '\d JUMP -> \d\+\_s*' .. ! '\d PUSH v:exception\_s*' .. ! '\d PUSHS "fail"\_s*' .. ! '\d COMPARESTRING =\~\_s*' .. ! '\d JUMP_IF_FALSE -> \d\+\_s*' .. ! '\d CATCH\_s*' .. ! 'echo "no"\_s*' .. ! '\d\+ PUSHS "no"\_s*' .. ! '\d\+ ECHO 1\_s*' .. ! 'finally\_s*' .. ! 'throw "end"\_s*' .. ! '\d\+ PUSHS "end"\_s*' .. ! '\d\+ THROW\_s*' .. ! 'endtry\_s*' .. ! '\d\+ ENDTRY', res) enddef *************** *** 213,230 **** def Test_disassemble_new() let res = execute('disass s:ScriptFuncNew') ! assert_match('\d*_ScriptFuncNew.*' .. ! 'let ll = \[1, "two", 333].*' .. ! 'PUSHNR 1.*' .. ! 'PUSHS "two".*' .. ! 'PUSHNR 333.*' .. ! 'NEWLIST size 3.*' .. ! 'let dd = #{one: 1, two: "val"}.*' .. ! 'PUSHS "one".*' .. ! 'PUSHNR 1.*' .. ! 'PUSHS "two".*' .. ! 'PUSHS "val".*' .. ! 'NEWDICT size 2.*', res) enddef --- 251,269 ---- def Test_disassemble_new() let res = execute('disass s:ScriptFuncNew') ! assert_match('\d*_ScriptFuncNew\_s*' .. ! 'let ll = \[1, "two", 333\]\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d PUSHS "two"\_s*' .. ! '\d PUSHNR 333\_s*' .. ! '\d NEWLIST size 3\_s*' .. ! '\d STORE $0\_s*' .. ! 'let dd = #{one: 1, two: "val"}\_s*' .. ! '\d PUSHS "one"\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d PUSHS "two"\_s*' .. ! '\d PUSHS "val"\_s*' .. ! '\d NEWDICT size 2\_s*', res) enddef *************** *** 258,295 **** def Test_disassemble_call() let res = execute('disass s:ScriptFuncCall') ! assert_match('\d\+_ScriptFuncCall.*' .. ! 'changenr().*' .. ! ' BCALL changenr(argc 0).*' .. ! 'char2nr("abc").*' .. ! ' PUSHS "abc".*' .. ! ' BCALL char2nr(argc 1).*' .. ! 'Test_disassemble_new().*' .. ! ' DCALL Test_disassemble_new(argc 0).*' .. ! 'FuncWithArg(343).*' .. ! ' PUSHNR 343.*' .. ! ' DCALL FuncWithArg(argc 1).*' .. ! 'ScriptFuncNew().*' .. ! ' DCALL \d\+_ScriptFuncNew(argc 0).*' .. ! 's:ScriptFuncNew().*' .. ! ' DCALL \d\+_ScriptFuncNew(argc 0).*' .. ! 'UserFunc().*' .. ! ' UCALL UserFunc(argc 0).*' .. ! 'UserFuncWithArg("foo").*' .. ! ' PUSHS "foo".*' .. ! ' UCALL UserFuncWithArg(argc 1).*' .. ! 'let FuncRef = function("UserFunc").*' .. ! 'FuncRef().*' .. ! ' LOAD $\d.*' .. ! ' PCALL (argc 0).*' .. ! 'let FuncRefWithArg = function("UserFuncWithArg").*' .. ! 'FuncRefWithArg("bar").*' .. ! ' PUSHS "bar".*' .. ! ' LOAD $\d.*' .. ! ' PCALL (argc 1).*' .. ! 'return "yes".*' .. ! ' PUSHS "yes".*' .. ! ' RETURN.*', res) enddef --- 297,350 ---- def Test_disassemble_call() let res = execute('disass s:ScriptFuncCall') ! assert_match('\d\+_ScriptFuncCall\_s*' .. ! 'changenr()\_s*' .. ! '\d BCALL changenr(argc 0)\_s*' .. ! '\d DROP\_s*' .. ! 'char2nr("abc")\_s*' .. ! '\d PUSHS "abc"\_s*' .. ! '\d BCALL char2nr(argc 1)\_s*' .. ! '\d DROP\_s*' .. ! 'Test_disassemble_new()\_s*' .. ! '\d DCALL Test_disassemble_new(argc 0)\_s*' .. ! '\d DROP\_s*' .. ! 'FuncWithArg(343)\_s*' .. ! '\d\+ PUSHNR 343\_s*' .. ! '\d\+ DCALL FuncWithArg(argc 1)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'ScriptFuncNew()\_s*' .. ! '\d\+ DCALL \d\+_ScriptFuncNew(argc 0)\_s*' .. ! '\d\+ DROP\_s*' .. ! 's:ScriptFuncNew()\_s*' .. ! '\d\+ DCALL \d\+_ScriptFuncNew(argc 0)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'UserFunc()\_s*' .. ! '\d\+ UCALL UserFunc(argc 0)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'UserFuncWithArg("foo")\_s*' .. ! '\d\+ PUSHS "foo"\_s*' .. ! '\d\+ UCALL UserFuncWithArg(argc 1)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'let FuncRef = function("UserFunc")\_s*' .. ! '\d\+ PUSHS "UserFunc"\_s*' .. ! '\d\+ BCALL function(argc 1)\_s*' .. ! '\d\+ STORE $0\_s*' .. ! 'FuncRef()\_s*' .. ! '\d\+ LOAD $\d\_s*' .. ! '\d\+ PCALL (argc 0)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'let FuncRefWithArg = function("UserFuncWithArg")\_s*' .. ! '\d\+ PUSHS "UserFuncWithArg"\_s*' .. ! '\d\+ BCALL function(argc 1)\_s*' .. ! '\d\+ STORE $1\_s*' .. ! 'FuncRefWithArg("bar")\_s*' .. ! '\d\+ PUSHS "bar"\_s*' .. ! '\d\+ LOAD $\d\_s*' .. ! '\d\+ PCALL (argc 1)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'return "yes"\_s*' .. ! '\d\+ PUSHS "yes"\_s*' .. ! '\d\+ RETURN', res) enddef *************** *** 308,328 **** def Test_disassemble_closure() CreateRefs() let res = execute('disass g:Append') ! assert_match('\d.*' .. ! 'local ..= arg.*' .. ! '\d LOADOUTER $0.*' .. ! '\d LOAD arg\[-1\].*' .. ! '\d CONCAT.*' .. ! '\d STOREOUTER $0.*' .. ! '\d PUSHNR 0.*' .. ! '\d RETURN.*', res) res = execute('disass g:Get') ! assert_match('\d.*' .. ! 'return local.*' .. ! '\d LOADOUTER $0.*' .. ! '\d RETURN.*', res) unlet g:Append --- 363,383 ---- def Test_disassemble_closure() CreateRefs() let res = execute('disass g:Append') ! assert_match('\d\_s*' .. ! 'local ..= arg\_s*' .. ! '\d LOADOUTER $0\_s*' .. ! '\d LOAD arg\[-1\]\_s*' .. ! '\d CONCAT\_s*' .. ! '\d STOREOUTER $0\_s*' .. ! '\d PUSHNR 0\_s*' .. ! '\d RETURN', res) res = execute('disass g:Get') ! assert_match('\d\_s*' .. ! 'return local\_s*' .. ! '\d LOADOUTER $0\_s*' .. ! '\d RETURN', res) unlet g:Append *************** *** 342,356 **** def Test_disassemble_pcall() let res = execute('disass s:ScriptPCall') ! assert_match('\d\+_ScriptPCall.*' .. ! 'RefThis()("text").*' .. ! '\d DCALL RefThis(argc 0).*' .. ! '\d PUSHS "text".*' .. ! '\d PCALL top (argc 1).*' .. ! '\d PCALL end.*' .. ! '\d DROP.*' .. ! '\d PUSHNR 0.*' .. ! '\d RETURN.*', res) enddef --- 397,411 ---- def Test_disassemble_pcall() let res = execute('disass s:ScriptPCall') ! assert_match('\d\+_ScriptPCall\_s*' .. ! 'RefThis()("text")\_s*' .. ! '\d DCALL RefThis(argc 0)\_s*' .. ! '\d PUSHS "text"\_s*' .. ! '\d PCALL top (argc 1)\_s*' .. ! '\d PCALL end\_s*' .. ! '\d DROP\_s*' .. ! '\d PUSHNR 0\_s*' .. ! '\d RETURN', res) enddef *************** *** 365,388 **** def Test_disassemble_update_instr() let res = execute('disass s:FuncWithForwardCall') ! assert_match('FuncWithForwardCall.*' .. ! 'return g:DefinedLater("yes").*' .. ! '\d PUSHS "yes".*' .. ! '\d UCALL g:DefinedLater(argc 1).*' .. ! '\d CHECKTYPE string stack\[-1].*' .. ! '\d RETURN.*', res) " Calling the function will change UCALL into the faster DCALL assert_equal('yes', FuncWithForwardCall()) res = execute('disass s:FuncWithForwardCall') ! assert_match('FuncWithForwardCall.*' .. ! 'return g:DefinedLater("yes").*' .. ! '\d PUSHS "yes".*' .. ! '\d DCALL DefinedLater(argc 1).*' .. ! '\d CHECKTYPE string stack\[-1].*' .. ! '\d RETURN.*', res) enddef --- 420,443 ---- def Test_disassemble_update_instr() let res = execute('disass s:FuncWithForwardCall') ! assert_match('FuncWithForwardCall\_s*' .. ! 'return g:DefinedLater("yes")\_s*' .. ! '\d PUSHS "yes"\_s*' .. ! '\d UCALL g:DefinedLater(argc 1)\_s*' .. ! '\d CHECKTYPE string stack\[-1]\_s*' .. ! '\d RETURN', res) " Calling the function will change UCALL into the faster DCALL assert_equal('yes', FuncWithForwardCall()) res = execute('disass s:FuncWithForwardCall') ! assert_match('FuncWithForwardCall\_s*' .. ! 'return g:DefinedLater("yes")\_s*' .. ! '\d PUSHS "yes"\_s*' .. ! '\d DCALL DefinedLater(argc 1)\_s*' .. ! '\d CHECKTYPE string stack\[-1]\_s*' .. ! '\d RETURN', res) enddef *************** *** 393,404 **** def Test_disassemble_call_default() let res = execute('disass FuncWithDefault') ! assert_match('FuncWithDefault.*' .. ! '\d PUSHS "default".*' .. ! '\d STORE arg\[-1].*' .. ! 'return arg.*' .. ! '\d LOAD arg\[-1].*' .. ! '\d RETURN.*', res) enddef --- 448,459 ---- def Test_disassemble_call_default() let res = execute('disass FuncWithDefault') ! assert_match('FuncWithDefault\_s*' .. ! '\d PUSHS "default"\_s*' .. ! '\d STORE arg\[-1]\_s*' .. ! 'return arg\_s*' .. ! '\d LOAD arg\[-1]\_s*' .. ! '\d RETURN', res) enddef *************** *** 434,451 **** def Test_disassemble_const_expr() assert_equal("\nyes", execute('call HasEval()')) let instr = execute('disassemble HasEval') ! assert_match('HasEval.*' .. ! 'if has("eval").*' .. ! ' PUSHS "yes".*', instr) assert_notmatch('JUMP', instr) assert_equal("\nno", execute('call HasNothing()')) instr = execute('disassemble HasNothing') ! assert_match('HasNothing.*' .. ! 'if has("nothing").*' .. ! 'else.*' .. ! ' PUSHS "no".*', instr) assert_notmatch('PUSHS "yes"', instr) assert_notmatch('JUMP', instr) --- 489,515 ---- def Test_disassemble_const_expr() assert_equal("\nyes", execute('call HasEval()')) let instr = execute('disassemble HasEval') ! assert_match('HasEval\_s*' .. ! 'if has("eval")\_s*' .. ! 'echo "yes"\_s*' .. ! '\d PUSHS "yes"\_s*' .. ! '\d ECHO 1\_s*' .. ! 'else\_s*' .. ! 'echo "no"\_s*' .. ! 'endif\_s*', instr) assert_notmatch('JUMP', instr) assert_equal("\nno", execute('call HasNothing()')) instr = execute('disassemble HasNothing') ! assert_match('HasNothing\_s*' .. ! 'if has("nothing")\_s*' .. ! 'echo "yes"\_s*' .. ! 'else\_s*' .. ! 'echo "no"\_s*' .. ! '\d PUSHS "no"\_s*' .. ! '\d ECHO 1\_s*' .. ! 'endif', instr) assert_notmatch('PUSHS "yes"', instr) assert_notmatch('JUMP', instr) *************** *** 453,463 **** assert_equal("\neval", execute('call HasSomething()')) instr = execute('disassemble HasSomething') assert_match('HasSomething.*' .. ! 'if has("nothing").*' .. ! 'elseif has("something").*' .. ! 'elseif has("eval").*' .. ! ' PUSHS "eval".*' .. ! 'elseif has("less").*', instr) assert_notmatch('PUSHS "nothing"', instr) assert_notmatch('PUSHS "something"', instr) --- 517,533 ---- assert_equal("\neval", execute('call HasSomething()')) instr = execute('disassemble HasSomething') assert_match('HasSomething.*' .. ! 'if has("nothing")\_s*' .. ! 'echo "nothing"\_s*' .. ! 'elseif has("something")\_s*' .. ! 'echo "something"\_s*' .. ! 'elseif has("eval")\_s*' .. ! 'echo "eval"\_s*' .. ! '\d PUSHS "eval"\_s*' .. ! '\d ECHO 1\_s*' .. ! 'elseif has("less").*' .. ! 'echo "less"\_s*' .. ! 'endif', instr) assert_notmatch('PUSHS "nothing"', instr) assert_notmatch('PUSHS "something"', instr) *************** *** 473,492 **** def Test_disassemble_function() let instr = execute('disassemble WithFunc') ! assert_match('WithFunc.*' .. ! 'let Funky1: func.*' .. ! '0 PUSHFUNC "\[none]".*' .. ! '1 STORE $0.*' .. ! 'let Funky2: func = function("len").*' .. ! '2 PUSHS "len".*' .. ! '3 BCALL function(argc 1).*' .. ! '4 STORE $1.*' .. ! 'let Party2: func = funcref("UserFunc").*' .. ! '\d PUSHS "UserFunc".*' .. ! '\d BCALL funcref(argc 1).*' .. ! '\d STORE $2.*' .. ! '\d PUSHNR 0.*' .. ! '\d RETURN.*', instr) enddef --- 543,562 ---- def Test_disassemble_function() let instr = execute('disassemble WithFunc') ! assert_match('WithFunc\_s*' .. ! 'let Funky1: func\_s*' .. ! '0 PUSHFUNC "\[none]"\_s*' .. ! '1 STORE $0\_s*' .. ! 'let Funky2: func = function("len")\_s*' .. ! '2 PUSHS "len"\_s*' .. ! '3 BCALL function(argc 1)\_s*' .. ! '4 STORE $1\_s*' .. ! 'let Party2: func = funcref("UserFunc")\_s*' .. ! '\d PUSHS "UserFunc"\_s*' .. ! '\d BCALL funcref(argc 1)\_s*' .. ! '\d STORE $2\_s*' .. ! '\d PUSHNR 0\_s*' .. ! '\d RETURN', instr) enddef *************** *** 502,520 **** CheckFeature channel let instr = execute('disassemble WithChannel') ! assert_match('WithChannel.*' .. ! 'let job1: job.*' .. ! '\d PUSHJOB "no process".*' .. ! '\d STORE $0.*' .. ! 'let job2: job = job_start("donothing").*' .. ! '\d PUSHS "donothing".*' .. ! '\d BCALL job_start(argc 1).*' .. ! '\d STORE $1.*' .. ! 'let chan1: channel.*' .. ! '\d PUSHCHANNEL 0.*' .. ! '\d STORE $2.*' .. ! '\d PUSHNR 0.*' .. ! '\d RETURN.*', instr) enddef --- 572,590 ---- CheckFeature channel let instr = execute('disassemble WithChannel') ! assert_match('WithChannel\_s*' .. ! 'let job1: job\_s*' .. ! '\d PUSHJOB "no process"\_s*' .. ! '\d STORE $0\_s*' .. ! 'let job2: job = job_start("donothing")\_s*' .. ! '\d PUSHS "donothing"\_s*' .. ! '\d BCALL job_start(argc 1)\_s*' .. ! '\d STORE $1\_s*' .. ! 'let chan1: channel\_s*' .. ! '\d PUSHCHANNEL 0\_s*' .. ! '\d STORE $2\_s*' .. ! '\d PUSHNR 0\_s*' .. ! '\d RETURN', instr) enddef *************** *** 526,538 **** def Test_disassemble_lambda() assert_equal("XxX", WithLambda()) let instr = execute('disassemble WithLambda') ! assert_match('WithLambda.*' .. ! 'let F = {a -> "X" .. a .. "X"}.*' .. ! ' FUNCREF \d\+.*' .. ! 'PUSHS "x".*' .. ! ' LOAD $0.*' .. ! ' PCALL (argc 1).*' .. ! ' CHECKTYPE string stack\[-1].*', instr) enddef --- 596,610 ---- def Test_disassemble_lambda() assert_equal("XxX", WithLambda()) let instr = execute('disassemble WithLambda') ! assert_match('WithLambda\_s*' .. ! 'let F = {a -> "X" .. a .. "X"}\_s*' .. ! '\d FUNCREF \d\+ $1\_s*' .. ! '\d STORE $0\_s*' .. ! 'return F("x")\_s*' .. ! '\d PUSHS "x"\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d PCALL (argc 1)\_s*' .. ! '\d CHECKTYPE string stack\[-1]', instr) enddef *************** *** 548,567 **** assert_equal("no", AndOr(2)) assert_equal("yes", AndOr(4)) let instr = execute('disassemble AndOr') ! assert_match('AndOr.*' .. ! 'if arg == 1 && arg != 2 || arg == 4.*' .. ! '\d LOAD arg\[-1].*' .. ! '\d PUSHNR 1.*' .. ! '\d COMPAREANY ==.*' .. ! '\d JUMP_AND_KEEP_IF_FALSE -> \d\+.*' .. ! '\d LOAD arg\[-1].*' .. ! '\d PUSHNR 2.*' .. ! '\d COMPAREANY !=.*' .. ! '\d JUMP_AND_KEEP_IF_TRUE -> \d\+.*' .. ! '\d LOAD arg\[-1].*' .. ! '\d PUSHNR 4.*' .. ! '\d COMPAREANY ==.*' .. ! '\d JUMP_IF_FALSE -> \d\+.*', instr) enddef --- 620,639 ---- assert_equal("no", AndOr(2)) assert_equal("yes", AndOr(4)) let instr = execute('disassemble AndOr') ! assert_match('AndOr\_s*' .. ! 'if arg == 1 && arg != 2 || arg == 4\_s*' .. ! '\d LOAD arg\[-1]\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d COMPAREANY ==\_s*' .. ! '\d JUMP_AND_KEEP_IF_FALSE -> \d\+\_s*' .. ! '\d LOAD arg\[-1]\_s*' .. ! '\d PUSHNR 2\_s*' .. ! '\d COMPAREANY !=\_s*' .. ! '\d JUMP_AND_KEEP_IF_TRUE -> \d\+\_s*' .. ! '\d LOAD arg\[-1]\_s*' .. ! '\d\+ PUSHNR 4\_s*' .. ! '\d\+ COMPAREANY ==\_s*' .. ! '\d\+ JUMP_IF_FALSE -> \d\+', instr) enddef *************** *** 576,599 **** def Test_disassemble_for_loop() assert_equal([0, 1, 2], ForLoop()) let instr = execute('disassemble ForLoop') ! assert_match('ForLoop.*' .. ! 'let res: list.*' .. ! ' NEWLIST size 0.*' .. ! '\d STORE $0.*' .. ! 'for i in range(3).*' .. ! '\d STORE -1 in $1.*' .. ! '\d PUSHNR 3.*' .. ! '\d BCALL range(argc 1).*' .. ! '\d FOR $1 -> \d\+.*' .. ! '\d STORE $2.*' .. ! 'res->add(i).*' .. ! '\d LOAD $0.*' .. ! '\d LOAD $2.*' .. ! '\d BCALL add(argc 2).*' .. ! '\d DROP.*' .. ! 'endfor.*' .. ! '\d JUMP -> \d\+.*' .. ! '\d DROP.*', instr) enddef --- 648,671 ---- def Test_disassemble_for_loop() assert_equal([0, 1, 2], ForLoop()) let instr = execute('disassemble ForLoop') ! assert_match('ForLoop\_s*' .. ! 'let res: list\_s*' .. ! '\d NEWLIST size 0\_s*' .. ! '\d STORE $0\_s*' .. ! 'for i in range(3)\_s*' .. ! '\d STORE -1 in $1\_s*' .. ! '\d PUSHNR 3\_s*' .. ! '\d BCALL range(argc 1)\_s*' .. ! '\d FOR $1 -> \d\+\_s*' .. ! '\d STORE $2\_s*' .. ! 'res->add(i)\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d LOAD $2\_s*' .. ! '\d\+ BCALL add(argc 2)\_s*' .. ! '\d\+ DROP\_s*' .. ! 'endfor\_s*' .. ! '\d\+ JUMP -> \d\+\_s*' .. ! '\d\+ DROP', instr) enddef *** ../vim-8.2.0757/src/version.c 2020-05-15 19:21:28.349090291 +0200 --- src/version.c 2020-05-15 19:42:53.424079509 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 758, /**/ -- hundred-and-one symptoms of being an internet addict: 95. Only communication in your household is through email. /// 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 ///