comparison src/eval.c @ 5473:60a5b7b82016 v7.4.086

updated for version 7.4.086 Problem: Skipping over an expression when not evaluating it does not work properly for dict members. Solution: Skip over unrecognized expression. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Mon, 11 Nov 2013 04:25:53 +0100
parents 6ae816249627
children 1e28c0fad344
comparison
equal deleted inserted replaced
5472:3f4e943e122a 5473:60a5b7b82016
19843 typval_T functv; 19843 typval_T functv;
19844 19844
19845 while (ret == OK 19845 while (ret == OK
19846 && (**arg == '[' 19846 && (**arg == '['
19847 || (**arg == '.' && rettv->v_type == VAR_DICT) 19847 || (**arg == '.' && rettv->v_type == VAR_DICT)
19848 || (**arg == '(' && rettv->v_type == VAR_FUNC)) 19848 || (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC)))
19849 && !vim_iswhite(*(*arg - 1))) 19849 && !vim_iswhite(*(*arg - 1)))
19850 { 19850 {
19851 if (**arg == '(') 19851 if (**arg == '(')
19852 { 19852 {
19853 /* need to copy the funcref so that we can clear rettv */ 19853 /* need to copy the funcref so that we can clear rettv */
19854 functv = *rettv; 19854 if (evaluate)
19855 rettv->v_type = VAR_UNKNOWN; 19855 {
19856 19856 functv = *rettv;
19857 /* Invoke the function. Recursive! */ 19857 rettv->v_type = VAR_UNKNOWN;
19858 s = functv.vval.v_string; 19858
19859 /* Invoke the function. Recursive! */
19860 s = functv.vval.v_string;
19861 }
19862 else
19863 s = (char_u *)"";
19859 ret = get_func_tv(s, (int)STRLEN(s), rettv, arg, 19864 ret = get_func_tv(s, (int)STRLEN(s), rettv, arg,
19860 curwin->w_cursor.lnum, curwin->w_cursor.lnum, 19865 curwin->w_cursor.lnum, curwin->w_cursor.lnum,
19861 &len, evaluate, selfdict); 19866 &len, evaluate, selfdict);
19862 19867
19863 /* Clear the funcref afterwards, so that deleting it while 19868 /* Clear the funcref afterwards, so that deleting it while
19864 * evaluating the arguments is possible (see test55). */ 19869 * evaluating the arguments is possible (see test55). */
19865 clear_tv(&functv); 19870 if (evaluate)
19871 clear_tv(&functv);
19866 19872
19867 /* Stop the expression evaluation when immediately aborting on 19873 /* Stop the expression evaluation when immediately aborting on
19868 * error, or when an interrupt occurred or an exception was thrown 19874 * error, or when an interrupt occurred or an exception was thrown
19869 * but not caught. */ 19875 * but not caught. */
19870 if (aborting()) 19876 if (aborting())