vim-patch:9.0.1505: error when heredoc content looks like heredoc (#23446)

Problem:    Error when heredoc content looks like heredoc.
Solution:   Handle curly expressions. (closes vim/vim#12325)

a93d9cdc74
This commit is contained in:
zeertzjq
2023-05-03 00:05:46 +08:00
committed by GitHub
parent f186224dfc
commit bff3f4fa8b
2 changed files with 70 additions and 14 deletions

View File

@@ -2587,19 +2587,13 @@ void ex_function(exarg_T *eap)
// Check for ":let v =<< [trim] EOF"
// and ":let [a, b] =<< [trim] EOF"
arg = skipwhite(skiptowhite(p));
if (*arg == '[') {
arg = vim_strchr(arg, ']');
}
if (arg != NULL) {
arg = skipwhite(skiptowhite(arg));
if (arg[0] == '='
&& arg[1] == '<'
&& arg[2] == '<'
&& (p[0] == 'l'
&& p[1] == 'e'
&& (!ASCII_ISALNUM(p[2])
|| (p[2] == 't' && !ASCII_ISALNUM(p[3]))))) {
arg = p;
if (checkforcmd(&arg, "let", 2)) {
while (vim_strchr("$@&", *arg) != NULL) {
arg++;
}
arg = skipwhite(find_name_end(arg, NULL, NULL, FNE_INCL_BR));
if (arg[0] == '=' && arg[1] == '<' && arg[2] == '<') {
p = skipwhite(arg + 3);
while (true) {
if (strncmp(p, "trim", 4) == 0) {