diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-28 19:41:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-28 19:41:33 +0100 |
commit | 33fa29cf74ea314f89cfa58ec9ffc2d6781a59d4 (patch) | |
tree | d0efad2d8d614a0e63505c62a3b18e5b91f5589d /src/dict.c | |
parent | 09c569038c42dcbdaa5c9b35fc9d1afbe5072cb4 (diff) |
patch 8.2.0467: Vim9: some errors are not testedv8.2.0467
Problem: Vim9: some errors are not tested
Solution: Add more tests. Fix that Vim9 script flag is not reset.
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dict.c b/src/dict.c index 2ff4ae37f7..1a928a35f2 100644 --- a/src/dict.c +++ b/src/dict.c @@ -826,7 +826,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal) if (**arg != ':') { - semsg(_(e_missing_dict_colon), *arg); + if (evaluate) + semsg(_(e_missing_dict_colon), *arg); clear_tv(&tvkey); goto failret; } @@ -853,7 +854,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal) item = dict_find(d, key, -1); if (item != NULL) { - semsg(_(e_duplicate_key), key); + if (evaluate) + semsg(_(e_duplicate_key), key); clear_tv(&tvkey); clear_tv(&tv); goto failret; @@ -873,7 +875,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal) break; if (**arg != ',') { - semsg(_(e_missing_dict_comma), *arg); + if (evaluate) + semsg(_(e_missing_dict_comma), *arg); goto failret; } *arg = skipwhite(*arg + 1); @@ -881,7 +884,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal) if (**arg != '}') { - semsg(_(e_missing_dict_end), *arg); + if (evaluate) + semsg(_(e_missing_dict_end), *arg); failret: if (d != NULL) dict_free(d); |