comparison src/testdir/test_vim9_disassemble.vim @ 19904:bd4f91762d0f v8.2.0508

patch 8.2.0508: Vim9: func and partial types not done yet Commit: https://github.com/vim/vim/commit/d77a8525d5438cae49f670eb473ef60d87ca5f54 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 3 21:59:57 2020 +0200 patch 8.2.0508: Vim9: func and partial types not done yet Problem: Vim9: func and partial types not done yet Solution: Fill in details about func declaration, drop a separate partial declaration.
author Bram Moolenaar <Bram@vim.org>
date Fri, 03 Apr 2020 22:15:03 +0200
parents 5feb426d2ea1
children d4fa9db88d16
comparison
equal deleted inserted replaced
19903:dab021621df2 19904:bd4f91762d0f
360 enddef 360 enddef
361 361
362 def WithFunc() 362 def WithFunc()
363 let funky1: func 363 let funky1: func
364 let funky2: func = function("len") 364 let funky2: func = function("len")
365 let party1: partial 365 let party2: func = funcref("UserFunc")
366 let party2: partial = funcref("UserFunc")
367 enddef 366 enddef
368 367
369 def Test_disassemble_function() 368 def Test_disassemble_function()
370 let instr = execute('disassemble WithFunc') 369 let instr = execute('disassemble WithFunc')
371 assert_match('WithFunc.*' 370 assert_match('WithFunc.*'
374 \ .. '1 STORE $0.*' 373 \ .. '1 STORE $0.*'
375 \ .. 'let funky2: func = function("len").*' 374 \ .. 'let funky2: func = function("len").*'
376 \ .. '2 PUSHS "len".*' 375 \ .. '2 PUSHS "len".*'
377 \ .. '3 BCALL function(argc 1).*' 376 \ .. '3 BCALL function(argc 1).*'
378 \ .. '4 STORE $1.*' 377 \ .. '4 STORE $1.*'
379 \ .. 'let party1: partial.*' 378 \ .. 'let party2: func = funcref("UserFunc").*'
380 \ .. '5 PUSHPARTIAL "\[none]".*' 379 \ .. '\d PUSHS "UserFunc".*'
381 \ .. '6 STORE $2.*' 380 \ .. '\d BCALL funcref(argc 1).*'
382 \ .. 'let party2: partial = funcref("UserFunc").*' 381 \ .. '\d STORE $2.*'
383 \ .. '7 PUSHS "UserFunc".*' 382 \ .. '\d PUSHNR 0.*'
384 \ .. '8 BCALL funcref(argc 1).*' 383 \ .. '\d RETURN.*'
385 \ .. '9 STORE $3.*'
386 \ .. '10 PUSHNR 0.*'
387 \ .. '11 RETURN.*'
388 \, instr) 384 \, instr)
389 enddef 385 enddef
390 386
391 if has('channel') 387 if has('channel')
392 def WithChannel() 388 def WithChannel()
751 \ ['#{a:1} == #{x:2}', 'COMPAREDICT =='], 747 \ ['#{a:1} == #{x:2}', 'COMPAREDICT =='],
752 \ ['#{a:1} != #{x:2}', 'COMPAREDICT !='], 748 \ ['#{a:1} != #{x:2}', 'COMPAREDICT !='],
753 \ ['#{a:1} is #{x:2}', 'COMPAREDICT is'], 749 \ ['#{a:1} is #{x:2}', 'COMPAREDICT is'],
754 \ ['#{a:1} isnot #{x:2}', 'COMPAREDICT isnot'], 750 \ ['#{a:1} isnot #{x:2}', 'COMPAREDICT isnot'],
755 \ 751 \
756 \ ['{->33} == {->44}', 'COMPAREPARTIAL =='], 752 \ ['{->33} == {->44}', 'COMPAREFUNC =='],
757 \ ['{->33} != {->44}', 'COMPAREPARTIAL !='], 753 \ ['{->33} != {->44}', 'COMPAREFUNC !='],
758 \ ['{->33} is {->44}', 'COMPAREPARTIAL is'], 754 \ ['{->33} is {->44}', 'COMPAREFUNC is'],
759 \ ['{->33} isnot {->44}', 'COMPAREPARTIAL isnot'], 755 \ ['{->33} isnot {->44}', 'COMPAREFUNC isnot'],
760 \ 756 \
761 \ ['77 == g:xx', 'COMPAREANY =='], 757 \ ['77 == g:xx', 'COMPAREANY =='],
762 \ ['77 != g:xx', 'COMPAREANY !='], 758 \ ['77 != g:xx', 'COMPAREANY !='],
763 \ ['77 > g:xx', 'COMPAREANY >'], 759 \ ['77 > g:xx', 'COMPAREANY >'],
764 \ ['77 < g:xx', 'COMPAREANY <'], 760 \ ['77 < g:xx', 'COMPAREANY <'],