Patch 8.2.3352
Problem:    Vim9: error for nested :enddef has wrong line number.
Solution:   Compute the line number.
Files:      src/userfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.3351/src/userfunc.c      2021-08-08 19:07:32.924667679 +0200
--- src/userfunc.c      2021-08-15 19:23:05.021181524 +0200
***************
*** 822,827 ****
--- 822,829 ----
                    else if (*p != NUL && *p != (vim9_function ? '#' : '"')
                                           && (vim9_function || p_verbose > 0))
                    {
+                       SOURCING_LNUM = sourcing_lnum_top
+                                                       + newlines->ga_len + 1;
                        if (eap->cmdidx == CMD_def)
                            semsg(_(e_text_found_after_enddef_str), p);
                        else
*** ../vim-8.2.3351/src/testdir/test_vim9_func.vim      2021-08-15 
16:08:32.374709637 +0200
--- src/testdir/test_vim9_func.vim      2021-08-15 19:26:44.720722616 +0200
***************
*** 630,635 ****
--- 630,646 ----
        assert_equal(2, Test())
    END
    CheckScriptSuccess(lines)
+ 
+   lines =<< trim END
+       vim9script
+       def Outer()
+         def Inner()
+           echo 'hello'
+         enddef burp
+       enddef
+       defcompile
+   END
+   CheckScriptFailure(lines, 'E1173: Text found after enddef: burp', 3)
  enddef
  
  def Test_not_nested_function()
*** ../vim-8.2.3351/src/version.c       2021-08-15 16:08:32.374709637 +0200
--- src/version.c       2021-08-15 19:24:38.652987509 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3352,
  /**/

-- 
User:       I'm having problems with my text editor.
Help desk:  Which editor are you using?
User:       I don't know, but it's version VI (pronounced: 6).
Help desk:  Oh, then you should upgrade to version VIM (pronounced: 994).

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/202108151728.17FHSgKR4054165%40masaka.moolenaar.net.

Raspunde prin e-mail lui