Patch 9.0.0732
Problem:    No check for white space before and after "=<<". (Doug Kearns)
Solution:   Check for white space in Vim9 script. (closes #11351)
Files:      src/evalvars.c, src/testdir/test_vim9_assign.vim


*** ../vim-9.0.0731/src/evalvars.c      2022-10-01 19:43:48.606494048 +0100
--- src/evalvars.c      2022-10-12 12:42:00.563305223 +0100
***************
*** 1066,1076 ****
      }
      else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<')
      {
!       list_T  *l;
        long    cur_lnum = SOURCING_LNUM;
  
!       // HERE document
!       l = heredoc_get(eap, expr + 3, FALSE, FALSE);
        if (l != NULL)
        {
            rettv_list_set(&rettv, l);
--- 1066,1083 ----
      }
      else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<')
      {
!       list_T  *l = NULL;
        long    cur_lnum = SOURCING_LNUM;
  
!       // :let text =<< [trim] [eval] END
!       // :var text =<< [trim] [eval] END
!       if (vim9script && !eap->skip && (!VIM_ISWHITE(expr[-1])
!                                                || !IS_WHITE_OR_NUL(expr[3])))
!           semsg(_(e_white_space_required_before_and_after_str_at_str),
!                                                                 "=<<", expr);
!       else
!           l = heredoc_get(eap, expr + 3, FALSE, FALSE);
! 
        if (l != NULL)
        {
            rettv_list_set(&rettv, l);
*** ../vim-9.0.0731/src/testdir/test_vim9_assign.vim    2022-09-18 
13:46:03.699664837 +0100
--- src/testdir/test_vim9_assign.vim    2022-10-12 12:46:51.226661137 +0100
***************
*** 1904,1909 ****
--- 1904,1928 ----
        STOP
    END
    v9.CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected number 
but got list<string>', 1)
+ 
+   lines =<< trim END
+       var lines=<< STOP
+         xxx
+       STOP
+   END
+   v9.CheckDefAndScriptFailure(lines, 'E1004: White space required before and 
after ''=<<'' at "=<< STOP"', 1)
+   lines =<< trim END
+       var lines =<<STOP
+         xxx
+       STOP
+   END
+   v9.CheckDefAndScriptFailure(lines, 'E1004: White space required before and 
after ''=<<'' at "=<<STOP"', 1)
+   lines =<< trim END
+       var lines=<<STOP
+         xxx
+       STOP
+   END
+   v9.CheckDefAndScriptFailure(lines, 'E1004: White space required before and 
after ''=<<'' at "=<<STOP"', 1)
  enddef
  
  def Test_var_func_call()
*** ../vim-9.0.0731/src/version.c       2022-10-12 12:09:35.308864295 +0100
--- src/version.c       2022-10-12 12:41:51.431329202 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     732,
  /**/

-- 
"It's so simple to be wise.  Just think of something stupid to say
and then don't say it."        -- Sam Levenson

 /// 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/20221012115926.3C01C1C5299%40moolenaar.net.

Raspunde prin e-mail lui