comparison src/list.c @ 23917:4b417b776b95 v8.2.2501

patch 8.2.2501: not always clear where an error is reported Commit: https://github.com/vim/vim/commit/f785aa1354208f6b644e891aa01f8f86d947af7e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 11 21:19:34 2021 +0100 patch 8.2.2501: not always clear where an error is reported Problem: Not always clear where an error is reported. Solution: Add the where_T structure and pass it around. (closes https://github.com/vim/vim/issues/7796)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Feb 2021 21:30:04 +0100
parents d95403445b6b
children 9fcd71d0db89
comparison
equal deleted inserted replaced
23916:cdb1a04f8189 23917:4b417b776b95
696 list_insert_tv(list_T *l, typval_T *tv, listitem_T *item) 696 list_insert_tv(list_T *l, typval_T *tv, listitem_T *item)
697 { 697 {
698 listitem_T *ni; 698 listitem_T *ni;
699 699
700 if (l->lv_type != NULL && l->lv_type->tt_member != NULL 700 if (l->lv_type != NULL && l->lv_type->tt_member != NULL
701 && check_typval_type(l->lv_type->tt_member, tv, 0) == FAIL) 701 && check_typval_arg_type(l->lv_type->tt_member, tv, 0) == FAIL)
702 return FAIL; 702 return FAIL;
703 ni = listitem_alloc(); 703 ni = listitem_alloc();
704 if (ni == NULL) 704 if (ni == NULL)
705 return FAIL; 705 return FAIL;
706 copy_tv(tv, &ni->li_tv); 706 copy_tv(tv, &ni->li_tv);
2133 clear_tv(&newtv); 2133 clear_tv(&newtv);
2134 break; 2134 break;
2135 } 2135 }
2136 if (filtermap == FILTERMAP_MAP) 2136 if (filtermap == FILTERMAP_MAP)
2137 { 2137 {
2138 if (type != NULL && check_typval_type(type->tt_member, 2138 if (type != NULL && check_typval_arg_type(
2139 &newtv, 0) == FAIL) 2139 type->tt_member, &newtv, 0) == FAIL)
2140 { 2140 {
2141 clear_tv(&newtv); 2141 clear_tv(&newtv);
2142 break; 2142 break;
2143 } 2143 }
2144 // map(): replace the dict item value 2144 // map(): replace the dict item value
2268 break; 2268 break;
2269 } 2269 }
2270 if (filtermap != FILTERMAP_FILTER) 2270 if (filtermap != FILTERMAP_FILTER)
2271 { 2271 {
2272 if (filtermap == FILTERMAP_MAP && type != NULL 2272 if (filtermap == FILTERMAP_MAP && type != NULL
2273 && check_typval_type(type->tt_member, 2273 && check_typval_arg_type(
2274 &newtv, 0) == FAIL) 2274 type->tt_member, &newtv, 0) == FAIL)
2275 { 2275 {
2276 clear_tv(&newtv); 2276 clear_tv(&newtv);
2277 break; 2277 break;
2278 } 2278 }
2279 // map(), mapnew(): always append the new value to the 2279 // map(), mapnew(): always append the new value to the
2312 clear_tv(&newtv); 2312 clear_tv(&newtv);
2313 break; 2313 break;
2314 } 2314 }
2315 if (filtermap == FILTERMAP_MAP) 2315 if (filtermap == FILTERMAP_MAP)
2316 { 2316 {
2317 if (type != NULL && check_typval_type(type->tt_member, 2317 if (type != NULL && check_typval_arg_type(
2318 &newtv, 0) == FAIL) 2318 type->tt_member, &newtv, 0) == FAIL)
2319 { 2319 {
2320 clear_tv(&newtv); 2320 clear_tv(&newtv);
2321 break; 2321 break;
2322 } 2322 }
2323 // map(): replace the list item value 2323 // map(): replace the list item value
2582 } 2582 }
2583 } 2583 }
2584 } 2584 }
2585 else 2585 else
2586 item = NULL; 2586 item = NULL;
2587 if (type != NULL && check_typval_type(type, &argvars[1], 2) == FAIL) 2587 if (type != NULL && check_typval_arg_type(
2588 type, &argvars[1], 2) == FAIL)
2588 goto theend; 2589 goto theend;
2589 list_extend(l1, l2, item); 2590 list_extend(l1, l2, item);
2590 2591
2591 if (is_new) 2592 if (is_new)
2592 { 2593 {
2639 } 2640 }
2640 } 2641 }
2641 else 2642 else
2642 action = (char_u *)"force"; 2643 action = (char_u *)"force";
2643 2644
2644 if (type != NULL && check_typval_type(type, &argvars[1], 2) == FAIL) 2645 if (type != NULL && check_typval_arg_type(
2646 type, &argvars[1], 2) == FAIL)
2645 goto theend; 2647 goto theend;
2646 dict_extend(d1, d2, action); 2648 dict_extend(d1, d2, action);
2647 2649
2648 if (is_new) 2650 if (is_new)
2649 { 2651 {