comparison src/userfunc.c @ 22415:1cefe1c013ac v8.2.1756

patch 8.2.1756: Vim9: :let will soon be disallowed Commit: https://github.com/vim/vim/commit/cfcd011fcd8021da52fba62dabf7a2497f1879b7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 27 15:19:27 2020 +0200 patch 8.2.1756: Vim9: :let will soon be disallowed Problem: Vim9: :let will soon be disallowed. Solution: Add v:disallow_let temporarily. Fix tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Sep 2020 15:30:04 +0200
parents b66a2e046c2e
children 454b78ca8247
comparison
equal deleted inserted replaced
22414:f22c7b159f37 22415:1cefe1c013ac
3212 skip_until = vim_strnsave(p, skiptowhite(p) - p); 3212 skip_until = vim_strnsave(p, skiptowhite(p) - p);
3213 getline_options = GETLINE_NONE; 3213 getline_options = GETLINE_NONE;
3214 is_heredoc = TRUE; 3214 is_heredoc = TRUE;
3215 } 3215 }
3216 3216
3217 // Check for ":let v =<< [trim] EOF" 3217 // Check for ":cmd v =<< [trim] EOF"
3218 // and ":let [a, b] =<< [trim] EOF" 3218 // and ":cmd [a, b] =<< [trim] EOF"
3219 // Where "cmd" can be "let", "var", "final" or "const".
3219 arg = skipwhite(skiptowhite(p)); 3220 arg = skipwhite(skiptowhite(p));
3220 if (*arg == '[') 3221 if (*arg == '[')
3221 arg = vim_strchr(arg, ']'); 3222 arg = vim_strchr(arg, ']');
3222 if (arg != NULL) 3223 if (arg != NULL)
3223 { 3224 {
3224 arg = skipwhite(skiptowhite(arg)); 3225 arg = skipwhite(skiptowhite(arg));
3225 if ( arg[0] == '=' && arg[1] == '<' && arg[2] =='<' 3226 if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
3226 && ((p[0] == 'l' 3227 && (checkforcmd(&p, "let", 2)
3227 && p[1] == 'e' 3228 || checkforcmd(&p, "var", 3)
3228 && (!ASCII_ISALNUM(p[2]) 3229 || checkforcmd(&p, "final", 5)
3229 || (p[2] == 't' && !ASCII_ISALNUM(p[3])))))) 3230 || checkforcmd(&p, "const", 5)))
3230 { 3231 {
3231 p = skipwhite(arg + 3); 3232 p = skipwhite(arg + 3);
3232 if (STRNCMP(p, "trim", 4) == 0) 3233 if (STRNCMP(p, "trim", 4) == 0)
3233 { 3234 {
3234 // Ignore leading white space. 3235 // Ignore leading white space.