Patch 8.2.1746
Problem:    Vim9: Cannot use "fina" for "finally". (Naruhiko Nishino)
Solution:   Specifically check for "fina". (closes #7020)
Files:      src/ex_docmd.c, src/testdir/test_trycatch.vim,
            src/testdir/test_vim9_script.vim


*** ../vim-8.2.1745/src/ex_docmd.c      2020-09-26 15:20:39.256399356 +0200
--- src/ex_docmd.c      2020-09-26 17:19:41.037374026 +0200
***************
*** 3420,3425 ****
--- 3420,3429 ----
            eap->cmdidx = CMD_SIZE;
      }
  
+     // ":fina" means ":finally" for backwards compatibility.
+     if (eap->cmdidx == CMD_final && p - eap->cmd == 4)
+       eap->cmdidx = CMD_finally;
+ 
      return p;
  }
  
*** ../vim-8.2.1745/src/testdir/test_trycatch.vim       2020-07-11 
22:14:54.318422203 +0200
--- src/testdir/test_trycatch.vim       2020-09-26 17:12:12.270588592 +0200
***************
*** 37,43 ****
          if loops == 2
            try
              Xpath 'f' . loops
!           finally
              Xpath 'g' . loops
            endtry
          endif
--- 37,43 ----
          if loops == 2
            try
              Xpath 'f' . loops
!           final
              Xpath 'g' . loops
            endtry
          endif
***************
*** 49,67 ****
    Xpath 'i'
  endfunc
  
  func T25_G()
    if 1
      try
        Xpath 'A'
        call T25_F()
        Xpath 'B'
!     finally
        Xpath 'C'
      endtry
    else
      try
        Xpath 'D'
!     finally
        Xpath 'E'
      endtry
    endif
--- 49,68 ----
    Xpath 'i'
  endfunc
  
+ " Also try using "fina" and "final" and "finall" as abbraviations.
  func T25_G()
    if 1
      try
        Xpath 'A'
        call T25_F()
        Xpath 'B'
!     fina
        Xpath 'C'
      endtry
    else
      try
        Xpath 'D'
!     finall
        Xpath 'E'
      endtry
    endif
*** ../vim-8.2.1745/src/testdir/test_vim9_script.vim    2020-09-26 
15:08:52.885779899 +0200
--- src/testdir/test_vim9_script.vim    2020-09-26 17:18:49.353514760 +0200
***************
*** 316,322 ****
      endtry
    catch /wrong/
      add(l, 'caught')
!   finally
      add(l, 'finally')
    endtry
    assert_equal(['1', 'caught', 'finally'], l)
--- 316,322 ----
      endtry
    catch /wrong/
      add(l, 'caught')
!   fina
      add(l, 'finally')
    endtry
    assert_equal(['1', 'caught', 'finally'], l)
***************
*** 526,532 ****
  def ReturnFinally(): string
    try
      return 'intry'
!   finally
      g:in_finally = 'finally'
    endtry
    return 'end'
--- 526,532 ----
  def ReturnFinally(): string
    try
      return 'intry'
!   finall
      g:in_finally = 'finally'
    endtry
    return 'end'
*** ../vim-8.2.1745/src/version.c       2020-09-26 15:20:39.256399356 +0200
--- src/version.c       2020-09-26 17:13:26.270389777 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1746,
  /**/

-- 
No engineer can take a shower without wondering if some sort of Teflon coating
would make showering unnecessary.
                                (Scott Adams - The Dilbert principle)

 /// 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/202009261521.08QFLIPT781599%40masaka.moolenaar.net.

Raspunde prin e-mail lui