comparison src/eval.c @ 1690:c6b06a4a8f92 v7.2b.023

updated for version 7.2b-023
author vimboss
date Sun, 27 Jul 2008 13:57:29 +0000
parents 75dbeedddaa9
children 9d74e2f433c0
comparison
equal deleted inserted replaced
1689:a285f0cd8a46 1690:c6b06a4a8f92
1273 else 1273 else
1274 { 1274 {
1275 if (dolist && tv.v_type == VAR_LIST) 1275 if (dolist && tv.v_type == VAR_LIST)
1276 { 1276 {
1277 ga_init2(&ga, (int)sizeof(char), 80); 1277 ga_init2(&ga, (int)sizeof(char), 80);
1278 list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0); 1278 if (tv.vval.v_list != NULL)
1279 list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0);
1279 ga_append(&ga, NUL); 1280 ga_append(&ga, NUL);
1280 retval = (char_u *)ga.ga_data; 1281 retval = (char_u *)ga.ga_data;
1281 } 1282 }
1282 else 1283 else
1283 retval = vim_strsave(get_tv_string(&tv)); 1284 retval = vim_strsave(get_tv_string(&tv));
1378 1379
1379 #if defined(FEAT_SPELL) || defined(PROTO) 1380 #if defined(FEAT_SPELL) || defined(PROTO)
1380 /* 1381 /*
1381 * Evaluate an expression to a list with suggestions. 1382 * Evaluate an expression to a list with suggestions.
1382 * For the "expr:" part of 'spellsuggest'. 1383 * For the "expr:" part of 'spellsuggest'.
1384 * Returns NULL when there is an error.
1383 */ 1385 */
1384 list_T * 1386 list_T *
1385 eval_spell_expr(badword, expr) 1387 eval_spell_expr(badword, expr)
1386 char_u *badword; 1388 char_u *badword;
1387 char_u *expr; 1389 char_u *expr;
1585 return retval; 1587 return retval;
1586 } 1588 }
1587 # endif 1589 # endif
1588 1590
1589 /* 1591 /*
1590 * Call vimL function "func" and return the result as a list 1592 * Call vimL function "func" and return the result as a List.
1591 * Uses argv[argc] for the function arguments. 1593 * Uses argv[argc] for the function arguments.
1594 * Returns NULL when there is something wrong.
1592 */ 1595 */
1593 void * 1596 void *
1594 call_func_retlist(func, argc, argv, safe) 1597 call_func_retlist(func, argc, argv, safe)
1595 char_u *func; 1598 char_u *func;
1596 int argc; 1599 int argc;
5815 list_T *l2; 5818 list_T *l2;
5816 int ic; /* ignore case for strings */ 5819 int ic; /* ignore case for strings */
5817 { 5820 {
5818 listitem_T *item1, *item2; 5821 listitem_T *item1, *item2;
5819 5822
5823 if (l1 == NULL || l2 == NULL)
5824 return FALSE;
5820 if (l1 == l2) 5825 if (l1 == l2)
5821 return TRUE; 5826 return TRUE;
5822 if (list_len(l1) != list_len(l2)) 5827 if (list_len(l1) != list_len(l2))
5823 return FALSE; 5828 return FALSE;
5824 5829
5853 { 5858 {
5854 hashitem_T *hi; 5859 hashitem_T *hi;
5855 dictitem_T *item2; 5860 dictitem_T *item2;
5856 int todo; 5861 int todo;
5857 5862
5863 if (d1 == NULL || d2 == NULL)
5864 return FALSE;
5858 if (d1 == d2) 5865 if (d1 == d2)
5859 return TRUE; 5866 return TRUE;
5860 if (dict_len(d1) != dict_len(d2)) 5867 if (dict_len(d1) != dict_len(d2))
5861 return FALSE; 5868 return FALSE;
5862 5869
6240 list_T *l1; 6247 list_T *l1;
6241 list_T *l2; 6248 list_T *l2;
6242 typval_T *tv; 6249 typval_T *tv;
6243 { 6250 {
6244 list_T *l; 6251 list_T *l;
6252
6253 if (l1 == NULL || l2 == NULL)
6254 return FAIL;
6245 6255
6246 /* make a copy of the first list. */ 6256 /* make a copy of the first list. */
6247 l = list_copy(l1, FALSE, 0); 6257 l = list_copy(l1, FALSE, 0);
6248 if (l == NULL) 6258 if (l == NULL)
6249 return FAIL; 6259 return FAIL;