patch 8.2.1861: Vim9: no specific error when parsing lambda fails
Problem: Vim9: no specific error when parsing lambda fails.
Solution: Also give syntax errors when not evaluating. (closes #7154)
diff --git a/src/dict.c b/src/dict.c
index 5725140..503f5a5 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -860,13 +860,10 @@
*arg = skipwhite(*arg);
if (**arg != ':')
{
- if (evaluate)
- {
- if (*skipwhite(*arg) == ':')
- semsg(_(e_no_white_space_allowed_before_str), ":");
- else
- semsg(_(e_missing_dict_colon), *arg);
- }
+ if (*skipwhite(*arg) == ':')
+ semsg(_(e_no_white_space_allowed_before_str), ":");
+ else
+ semsg(_(e_missing_dict_colon), *arg);
clear_tv(&tvkey);
goto failret;
}
@@ -899,8 +896,7 @@
item = dict_find(d, key, -1);
if (item != NULL)
{
- if (evaluate)
- semsg(_(e_duplicate_key), key);
+ semsg(_(e_duplicate_key), key);
clear_tv(&tvkey);
clear_tv(&tv);
goto failret;
@@ -937,21 +933,17 @@
break;
if (!had_comma)
{
- if (evaluate)
- {
- if (**arg == ',')
- semsg(_(e_no_white_space_allowed_before_str), ",");
- else
- semsg(_(e_missing_dict_comma), *arg);
- }
+ if (**arg == ',')
+ semsg(_(e_no_white_space_allowed_before_str), ",");
+ else
+ semsg(_(e_missing_dict_comma), *arg);
goto failret;
}
}
if (**arg != '}')
{
- if (evaluate)
- semsg(_(e_missing_dict_end), *arg);
+ semsg(_(e_missing_dict_end), *arg);
failret:
if (d != NULL)
dict_free(d);