Mercurial > vim
comparison src/vim9compile.c @ 27970:212c5894b8b1 v8.2.4510
patch 8.2.4510: Vim9: shortening commands leads to confusing script
Commit: https://github.com/vim/vim/commit/204852ae2adfdde10c656ca7f14e5b4207a69172
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 5 12:56:44 2022 +0000
patch 8.2.4510: Vim9: shortening commands leads to confusing script
Problem: Vim9: shortening commands leads to confusing script.
Solution: In Vim9 script require at least ":cont" for ":continue", "const"
instead of "cons", "break" instead of "brea", "catch" instead of
"cat", "else" instead of "el" "elseif" instead of "elsei" "endfor"
instead of "endfo" "endif" instead of "en" "endtry" instead of
"endt", "finally" instead of "fina", "throw" instead of "th",
"while" instead of "wh".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Mar 2022 14:00:03 +0100 |
parents | 40c6e5f849dc |
children | 1012048eed26 |
comparison
equal
deleted
inserted
replaced
27969:0e58183b329e | 27970:212c5894b8b1 |
---|---|
1880 type_T *rhs_type = &t_any; | 1880 type_T *rhs_type = &t_any; |
1881 char_u *sp; | 1881 char_u *sp; |
1882 int is_decl = is_decl_command(cmdidx); | 1882 int is_decl = is_decl_command(cmdidx); |
1883 lhs_T lhs; | 1883 lhs_T lhs; |
1884 long start_lnum = SOURCING_LNUM; | 1884 long start_lnum = SOURCING_LNUM; |
1885 | |
1886 p = eap->cmd; | |
1887 if (eap->cmdidx == CMD_var && arg > p && !checkforcmd_noparen(&p, "var", 3)) | |
1888 { | |
1889 emsg(_(e_must_use_var_instead_of_va)); | |
1890 return NULL; | |
1891 } | |
1892 | 1885 |
1893 // Skip over the "varname" or "[varname, varname]" to get to any "=". | 1886 // Skip over the "varname" or "[varname, varname]" to get to any "=". |
1894 p = skip_var_list(arg, TRUE, &var_count, &semicolon, TRUE); | 1887 p = skip_var_list(arg, TRUE, &var_count, &semicolon, TRUE); |
1895 if (p == NULL) | 1888 if (p == NULL) |
1896 return *arg == '[' ? arg : NULL; | 1889 return *arg == '[' ? arg : NULL; |