Patch 8.2.1683
Problem:    Vim9: assignment test fails.
Solution:   Include changes to find Ex command.
Files:      src/ex_docmd.c


*** ../vim-8.2.1682/src/ex_docmd.c      2020-09-14 16:37:30.906845912 +0200
--- src/ex_docmd.c      2020-09-14 18:09:11.086579727 +0200
***************
*** 3224,3242 ****
                            // "g:varname" is an expression.
                         || eap->cmd[1] == ':'
                            )
-                       : (
-                           // "varname[]" is an expression.
-                           *p == '['
                            // "varname->func()" is an expression.
!                        || (*p == '-' && p[1] == '>')
!                           // "varname.expr" is an expression.
!                        || (*p == '.' && ASCII_ISALPHA(p[1]))
!                        )))
            {
                eap->cmdidx = CMD_eval;
                return eap->cmd;
            }
  
            // "[...]->Method()" is a list expression, but "[a, b] = Func()" is
            // an assignment.
            // If there is no line break inside the "[...]" then "p" is
--- 3224,3256 ----
                            // "g:varname" is an expression.
                         || eap->cmd[1] == ':'
                            )
                            // "varname->func()" is an expression.
!                       : (*p == '-' && p[1] == '>')))
            {
                eap->cmdidx = CMD_eval;
                return eap->cmd;
            }
  
+           if (p != eap->cmd && (
+                           // "varname[]" is an expression.
+                           *p == '['
+                           // "varname.key" is an expression.
+                        || (*p == '.' && ASCII_ISALPHA(p[1]))))
+           {
+               char_u  *after = p;
+ 
+               // When followed by "=" or "+=" then it is an assignment.
+               ++emsg_silent;
+               if (skip_expr(&after) == OK
+                                 && (*after == '='
+                                     || (*after != NUL && after[1] == '=')))
+                   eap->cmdidx = CMD_let;
+               else
+                   eap->cmdidx = CMD_eval;
+               --emsg_silent;
+               return eap->cmd;
+           }
+ 
            // "[...]->Method()" is a list expression, but "[a, b] = Func()" is
            // an assignment.
            // If there is no line break inside the "[...]" then "p" is
*** ../vim-8.2.1682/src/version.c       2020-09-14 18:15:05.513520702 +0200
--- src/version.c       2020-09-14 18:35:01.884916541 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1683,
  /**/

-- 
If you only have a hammer, you tend to see every problem as a nail.
If you only have MS-Windows, you tend to solve every problem by rebooting.

 /// 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/202009141636.08EGaKr51677828%40masaka.moolenaar.net.

Raspunde prin e-mail lui