diff options
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/eval.c b/src/eval.c index 065f7853f7..14c2849e82 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2538,8 +2538,6 @@ eval_addlist(typval_T *tv1, typval_T *tv2) static int eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg) { - int evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE); - /* * Get the first variable. */ @@ -2551,6 +2549,7 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg) */ for (;;) { + int evaluate; int getnext; char_u *p; int op; @@ -2563,9 +2562,10 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg) concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2); if (op != '+' && op != '-' && !concat) break; + if (getnext) *arg = eval_next_line(evalarg); - + evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE); if ((op != '+' || (rettv->v_type != VAR_LIST && rettv->v_type != VAR_BLOB)) #ifdef FEAT_FLOAT @@ -2728,14 +2728,9 @@ eval6( evalarg_T *evalarg, int want_string) // after "." operator { - typval_T var2; - int op; - varnumber_T n1, n2; #ifdef FEAT_FLOAT - int use_float = FALSE; - float_T f1 = 0, f2 = 0; + int use_float = FALSE; #endif - int error = FALSE; /* * Get the first variable. @@ -2748,16 +2743,29 @@ eval6( */ for (;;) { - int evaluate = evalarg == NULL ? 0 - : (evalarg->eval_flags & EVAL_EVALUATE); - int getnext; + int evaluate; + int getnext; + typval_T var2; + int op; + varnumber_T n1, n2; +#ifdef FEAT_FLOAT + float_T f1, f2; +#endif + int error; op = *eval_next_non_blank(*arg, evalarg, &getnext); if (op != '*' && op != '/' && op != '%') break; + if (getnext) *arg = eval_next_line(evalarg); +#ifdef FEAT_FLOAT + f1 = 0; + f2 = 0; +#endif + error = FALSE; + evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE); if (evaluate) { #ifdef FEAT_FLOAT @@ -2904,7 +2912,6 @@ eval7( evalarg_T *evalarg, int want_string) // after "." operator { - int flags = evalarg == NULL ? 0 : evalarg->eval_flags; int evaluate = evalarg != NULL && (evalarg->eval_flags & EVAL_EVALUATE); int len; @@ -3064,6 +3071,8 @@ eval7( ret = FAIL; else { + int flags = evalarg == NULL ? 0 : evalarg->eval_flags; + if (**arg == '(') // "name(..." recursive! ret = eval_func(arg, evalarg, s, len, rettv, flags, NULL); |