Mercurial > vim
comparison src/dict.c @ 19822:fc3cdc819d80 v8.2.0467
patch 8.2.0467: Vim9: some errors are not tested
Commit: https://github.com/vim/vim/commit/33fa29cf74ea314f89cfa58ec9ffc2d6781a59d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 28 19:41:33 2020 +0100
patch 8.2.0467: Vim9: some errors are not tested
Problem: Vim9: some errors are not tested
Solution: Add more tests. Fix that Vim9 script flag is not reset.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 28 Mar 2020 19:45:04 +0100 |
parents | 94eda51ba9ba |
children | 0b35a7ffceb2 |
comparison
equal
deleted
inserted
replaced
19821:54157d9d75c7 | 19822:fc3cdc819d80 |
---|---|
824 : eval1(arg, &tvkey, evaluate)) == FAIL) // recursive! | 824 : eval1(arg, &tvkey, evaluate)) == FAIL) // recursive! |
825 goto failret; | 825 goto failret; |
826 | 826 |
827 if (**arg != ':') | 827 if (**arg != ':') |
828 { | 828 { |
829 semsg(_(e_missing_dict_colon), *arg); | 829 if (evaluate) |
830 semsg(_(e_missing_dict_colon), *arg); | |
830 clear_tv(&tvkey); | 831 clear_tv(&tvkey); |
831 goto failret; | 832 goto failret; |
832 } | 833 } |
833 if (evaluate) | 834 if (evaluate) |
834 { | 835 { |
851 if (evaluate) | 852 if (evaluate) |
852 { | 853 { |
853 item = dict_find(d, key, -1); | 854 item = dict_find(d, key, -1); |
854 if (item != NULL) | 855 if (item != NULL) |
855 { | 856 { |
856 semsg(_(e_duplicate_key), key); | 857 if (evaluate) |
858 semsg(_(e_duplicate_key), key); | |
857 clear_tv(&tvkey); | 859 clear_tv(&tvkey); |
858 clear_tv(&tv); | 860 clear_tv(&tv); |
859 goto failret; | 861 goto failret; |
860 } | 862 } |
861 item = dictitem_alloc(key); | 863 item = dictitem_alloc(key); |
871 | 873 |
872 if (**arg == '}') | 874 if (**arg == '}') |
873 break; | 875 break; |
874 if (**arg != ',') | 876 if (**arg != ',') |
875 { | 877 { |
876 semsg(_(e_missing_dict_comma), *arg); | 878 if (evaluate) |
879 semsg(_(e_missing_dict_comma), *arg); | |
877 goto failret; | 880 goto failret; |
878 } | 881 } |
879 *arg = skipwhite(*arg + 1); | 882 *arg = skipwhite(*arg + 1); |
880 } | 883 } |
881 | 884 |
882 if (**arg != '}') | 885 if (**arg != '}') |
883 { | 886 { |
884 semsg(_(e_missing_dict_end), *arg); | 887 if (evaluate) |
888 semsg(_(e_missing_dict_end), *arg); | |
885 failret: | 889 failret: |
886 if (d != NULL) | 890 if (d != NULL) |
887 dict_free(d); | 891 dict_free(d); |
888 return FAIL; | 892 return FAIL; |
889 } | 893 } |