Patch 8.2.1427
Problem:    Vim9: cannot use a range with marks in :def function.
Solution:   Parse range after colon. (closes #6686)
Files:      src/vim9compile.c, src/testdir/test_vim9_disassemble.vim


*** ../vim-8.2.1426/src/vim9compile.c   2020-08-12 15:21:18.970700474 +0200
--- src/vim9compile.c   2020-08-12 15:36:45.680431659 +0200
***************
*** 6567,6573 ****
         * 'text'->func() should not be confused with 'a mark
         */
        cmd = ea.cmd;
!       if (*cmd != '\'')
        {
            ea.cmd = skip_range(ea.cmd, NULL);
            if (ea.cmd > cmd && !starts_with_colon)
--- 6567,6573 ----
         * 'text'->func() should not be confused with 'a mark
         */
        cmd = ea.cmd;
!       if (*cmd != '\'' || starts_with_colon)
        {
            ea.cmd = skip_range(ea.cmd, NULL);
            if (ea.cmd > cmd && !starts_with_colon)
*** ../vim-8.2.1426/src/testdir/test_vim9_disassemble.vim       2020-08-09 
19:02:46.281077049 +0200
--- src/testdir/test_vim9_disassemble.vim       2020-08-12 15:47:49.378332259 
+0200
***************
*** 83,102 ****
  
  def Test_disassemble_exec_expr()
    let res = execute('disass s:EditExpand')
!   assert_match('<SNR>\d*_EditExpand.*' ..
!         ' let filename = "file".*' ..
!         '\d PUSHS "file".*' ..
!         '\d STORE $0.*' ..
!         ' let filenr = 123.*' ..
!         '\d STORE 123 in $1.*' ..
!         ' edit the`=filename``=filenr`.txt.*' ..
!         '\d PUSHS "edit the".*' ..
!         '\d LOAD $0.*' ..
!         '\d LOAD $1.*' ..
!         '\d 2STRING stack\[-1\].*' ..
!         '\d PUSHS ".txt".*' ..
!         '\d EXECCONCAT 4.*' ..
!         '\d PUSHNR 0.*' ..
          '\d RETURN',
          res)
  enddef
--- 83,119 ----
  
  def Test_disassemble_exec_expr()
    let res = execute('disass s:EditExpand')
!   assert_match('<SNR>\d*_EditExpand\_s*' ..
!         ' let filename = "file"\_s*' ..
!         '\d PUSHS "file"\_s*' ..
!         '\d STORE $0\_s*' ..
!         ' let filenr = 123\_s*' ..
!         '\d STORE 123 in $1\_s*' ..
!         ' edit the`=filename``=filenr`.txt\_s*' ..
!         '\d PUSHS "edit the"\_s*' ..
!         '\d LOAD $0\_s*' ..
!         '\d LOAD $1\_s*' ..
!         '\d 2STRING stack\[-1\]\_s*' ..
!         '\d\+ PUSHS ".txt"\_s*' ..
!         '\d\+ EXECCONCAT 4\_s*' ..
!         '\d\+ PUSHNR 0\_s*' ..
!         '\d\+ RETURN',
!         res)
! enddef
! 
! def s:YankRange()
!   norm! m[jjm]
!   :'[,']yank
! enddef
! 
! def Test_disassemble_yank_range()
!   let res = execute('disass s:YankRange')
!   assert_match('<SNR>\d*_YankRange.*' ..
!         ' norm! m\[jjm\]\_s*' ..
!         '\d EXEC   norm! m\[jjm\]\_s*' ..
!         '  :''\[,''\]yank\_s*' ..
!         '\d EXEC   :''\[,''\]yank\_s*' ..
!         '\d PUSHNR 0\_s*' ..
          '\d RETURN',
          res)
  enddef
*** ../vim-8.2.1426/src/version.c       2020-08-12 15:21:18.970700474 +0200
--- src/version.c       2020-08-12 15:37:50.360234867 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1427,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
178. You look for an icon to double-click to open your bedroom window.

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
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/202008121349.07CDnRIj057331%40masaka.moolenaar.net.

Raspunde prin e-mail lui