Mercurial > vim
comparison src/userfunc.c @ 34836:3b0c98b3a7b5 v9.1.0287
patch 9.1.0287: Vim9: comment may be treated as heredoc start
Commit: https://github.com/vim/vim/commit/9a91d2b72c20f213bbf77f27b7edd01e0e43d5e0
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Apr 9 21:47:10 2024 +0200
patch 9.1.0287: Vim9: comment may be treated as heredoc start
Problem: Vim9: comment may be treated as heredoc start.
(Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
(zeertzjq)
fixes: #14444
closes: #14446
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 09 Apr 2024 22:00:03 +0200 |
parents | 6d03fa3a05ad |
children | 443a527b43ed |
comparison
equal
deleted
inserted
replaced
34835:a5841d54e20a | 34836:3b0c98b3a7b5 |
---|---|
1225 || checkforcmd(&arg, "var", 3) | 1225 || checkforcmd(&arg, "var", 3) |
1226 || checkforcmd(&arg, "final", 5) | 1226 || checkforcmd(&arg, "final", 5) |
1227 || checkforcmd(&arg, "const", 5) | 1227 || checkforcmd(&arg, "const", 5) |
1228 || vim9_function) | 1228 || vim9_function) |
1229 { | 1229 { |
1230 while (vim_strchr((char_u *)"$@&", *arg) != NULL) | 1230 int save_sc_version = current_sctx.sc_version; |
1231 ++arg; | 1231 int var_count = 0; |
1232 arg = skipwhite(find_name_end(arg, NULL, NULL, | 1232 int semicolon = 0; |
1233 FNE_INCL_BR | FNE_ALLOW_CURLY)); | 1233 char_u *argend; |
1234 if (vim9_function && *arg == ':') | 1234 |
1235 arg = skipwhite(skip_type(skipwhite(arg + 1), FALSE)); | 1235 current_sctx.sc_version |
1236 = vim9_function ? SCRIPT_VERSION_VIM9 : 1; | |
1237 argend = skip_var_list(arg, TRUE, &var_count, &semicolon, | |
1238 TRUE); | |
1239 if (argend == NULL) | |
1240 // Invalid list assignment: skip to closing bracket. | |
1241 argend = find_name_end(arg, NULL, NULL, FNE_INCL_BR); | |
1242 arg = skipwhite(argend); | |
1243 current_sctx.sc_version = save_sc_version; | |
1236 if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<') | 1244 if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<') |
1237 { | 1245 { |
1238 p = skipwhite(arg + 3); | 1246 p = skipwhite(arg + 3); |
1239 while (TRUE) | 1247 while (TRUE) |
1240 { | 1248 { |