summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dict.c8
-rw-r--r--src/eval.c24
-rw-r--r--src/list.c4
-rw-r--r--src/proto/eval.pro1
-rw-r--r--src/version.c2
-rw-r--r--src/vim9script.c2
6 files changed, 15 insertions, 26 deletions
diff --git a/src/dict.c b/src/dict.c
index 53824f75d..a549ed71b 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -787,8 +787,8 @@ get_literal_key(char_u **arg, typval_T *tv)
/*
* Allocate a variable for a Dictionary and fill it from "*arg".
+ * "*arg" points to the "{".
* "literal" is TRUE for #{key: val}
- * "flags" can have EVAL_EVALUATE and other EVAL_ flags.
* Return OK or FAIL. Returns NOTDONE for {expr}.
*/
int
@@ -830,7 +830,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
tvkey.v_type = VAR_UNKNOWN;
tv.v_type = VAR_UNKNOWN;
- *arg = skipwhite_and_linebreak_keep_string(*arg + 1, evalarg);
+ *arg = skipwhite_and_linebreak(*arg + 1, evalarg);
while (**arg != '}' && **arg != NUL)
{
if ((literal
@@ -862,7 +862,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
goto failret;
}
- *arg = skipwhite_and_linebreak_keep_string(*arg + 1, evalarg);
+ *arg = skipwhite_and_linebreak(*arg + 1, evalarg);
if (eval1(arg, &tv, evalarg) == FAIL) // recursive!
{
if (evaluate)
@@ -904,7 +904,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
}
// the "}" can be on the next line
- *arg = skipwhite_and_linebreak_keep_string(*arg, evalarg);
+ *arg = skipwhite_and_linebreak(*arg, evalarg);
if (**arg == '}')
break;
if (!had_comma)
diff --git a/src/eval.c b/src/eval.c
index c569710ab..1468070ae 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1866,9 +1866,9 @@ eval_func(
}
/*
- * If inside Vim9 script, "arg" points to the end of a line (ignoring comments)
- * and there is a next line, return the next line (skipping blanks) and set
- * "getnext".
+ * If inside Vim9 script, "arg" points to the end of a line (ignoring a #
+ * comment) and there is a next line, return the next line (skipping blanks)
+ * and set "getnext".
* Otherwise just return "arg" unmodified and set "getnext" to FALSE.
* "arg" must point somewhere inside a line, not at the start.
*/
@@ -1880,7 +1880,7 @@ eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext)
&& evalarg != NULL
&& evalarg->eval_cookie != NULL
&& (*arg == NUL || (VIM_ISWHITE(arg[-1])
- && (*arg == '"' || *arg == '#'))))
+ && *arg == '#' && arg[1] != '{')))
{
char_u *p = getline_peek(evalarg->eval_getline, evalarg->eval_cookie);
@@ -1927,6 +1927,8 @@ skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg)
int getnext;
char_u *p = skipwhite(arg);
+ if (evalarg == NULL)
+ return skipwhite(arg);
eval_next_non_blank(p, evalarg, &getnext);
if (getnext)
return eval_next_line(evalarg);
@@ -1934,20 +1936,6 @@ skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg)
}
/*
- * Call eval_next_non_blank() and get the next line if needed, but not when a
- * double quote follows. Used inside an expression.
- */
- char_u *
-skipwhite_and_linebreak_keep_string(char_u *arg, evalarg_T *evalarg)
-{
- char_u *p = skipwhite(arg);
-
- if (*p == '"')
- return p;
- return skipwhite_and_linebreak(arg, evalarg);
-}
-
-/*
* After using "evalarg" filled from "eap" free the memory.
*/
void
diff --git a/src/list.c b/src/list.c
index 9475ef99e..e8d5f5f54 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1177,7 +1177,7 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
return FAIL;
}
- *arg = skipwhite_and_linebreak_keep_string(*arg + 1, evalarg);
+ *arg = skipwhite_and_linebreak(*arg + 1, evalarg);
while (**arg != ']' && **arg != NUL)
{
if (eval1(arg, &tv, evalarg) == FAIL) // recursive!
@@ -1209,7 +1209,7 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
// The "]" can be on the next line. But a double quoted string may
// follow, not a comment.
- *arg = skipwhite_and_linebreak_keep_string(*arg, evalarg);
+ *arg = skipwhite_and_linebreak(*arg, evalarg);
if (**arg == ']')
break;
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
index 910fdfd18..3e8790795 100644
--- a/src/proto/eval.pro
+++ b/src/proto/eval.pro
@@ -32,7 +32,6 @@ int pattern_match(char_u *pat, char_u *text, int ic);
char_u *eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext);
char_u *eval_next_line(evalarg_T *evalarg);
char_u *skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg);
-char_u *skipwhite_and_linebreak_keep_string(char_u *arg, evalarg_T *evalarg);
void clear_evalarg(evalarg_T *evalarg, exarg_T *eap);
int eval0(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg);
int eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg);
diff --git a/src/version.c b/src/version.c
index 2f4bb6bd5..b36f248f8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1125,
+/**/
1124,
/**/
1123,
diff --git a/src/vim9script.c b/src/vim9script.c
index 14586f9b8..ef447c7e3 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -342,7 +342,7 @@ handle_import(
goto erret;
}
- arg = skipwhite_and_linebreak_keep_string(arg + 4, evalarg);
+ arg = skipwhite_and_linebreak(arg + 4, evalarg);
tv.v_type = VAR_UNKNOWN;
// TODO: should we accept any expression?
if (*arg == '\'')