Mercurial > vim
comparison src/eval.c @ 4178:b40e6a47ee53 v7.3.841
updated for version 7.3.841
Problem: When a "cond ? one : two" expression has a subscript it is not
parsed correctly. (Andy Wokula)
Solution: Handle a subscript also when the type is unknown. (Christian
Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 26 Feb 2013 19:36:15 +0100 |
parents | cb185366f5c8 |
children | 78321dcaa8e2 |
comparison
equal
deleted
inserted
replaced
4177:2d0b1a0d4275 | 4178:b40e6a47ee53 |
---|---|
5162 | 5162 |
5163 /* Invoke the function. */ | 5163 /* Invoke the function. */ |
5164 ret = get_func_tv(s, len, rettv, arg, | 5164 ret = get_func_tv(s, len, rettv, arg, |
5165 curwin->w_cursor.lnum, curwin->w_cursor.lnum, | 5165 curwin->w_cursor.lnum, curwin->w_cursor.lnum, |
5166 &len, evaluate, NULL); | 5166 &len, evaluate, NULL); |
5167 | |
5168 /* If evaluate is FALSE rettv->v_type was not set in | |
5169 * get_func_tv, but it's needed in handle_subscript() to parse | |
5170 * what follows. So set it here. */ | |
5171 if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(') | |
5172 { | |
5173 rettv->vval.v_string = vim_strsave(""); | |
5174 rettv->v_type = VAR_FUNC; | |
5175 } | |
5176 | |
5167 /* Stop the expression evaluation when immediately | 5177 /* Stop the expression evaluation when immediately |
5168 * aborting on error, or when an interrupt occurred or | 5178 * aborting on error, or when an interrupt occurred or |
5169 * an exception was thrown but not caught. */ | 5179 * an exception was thrown but not caught. */ |
5170 if (aborting()) | 5180 if (aborting()) |
5171 { | 5181 { |