summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-18 18:03:17 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-18 18:03:17 +0200
commita2c026d0fd470d68d679616fddfc285cb4834412 (patch)
treed27998d17bcf402ed722648db7ced31fa76f5f0a /src/dict.c
parent335e67132265b068f39f3671e5dff2aecd1bf403 (diff)
downloadvim-git-a2c026d0fd470d68d679616fddfc285cb4834412.tar.gz
patch 8.2.1861: Vim9: no specific error when parsing lambda failsv8.2.1861
Problem: Vim9: no specific error when parsing lambda fails. Solution: Also give syntax errors when not evaluating. (closes #7154)
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/dict.c b/src/dict.c
index 5725140df..503f5a522 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -860,13 +860,10 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
*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 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
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 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
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);