Mirror of the Vim source from https://github.com/vim/vim
リビジョン | 6412b0befebc17db58a1e8acbef86d3a3e4f742c (tree) |
---|---|
日時 | 2008-06-28 22:09:56 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.2a-007
@@ -405,8 +405,8 @@ | ||
405 | 405 | static int eval3 __ARGS((char_u **arg, typval_T *rettv, int evaluate)); |
406 | 406 | static int eval4 __ARGS((char_u **arg, typval_T *rettv, int evaluate)); |
407 | 407 | static int eval5 __ARGS((char_u **arg, typval_T *rettv, int evaluate)); |
408 | -static int eval6 __ARGS((char_u **arg, typval_T *rettv, int evaluate)); | |
409 | -static int eval7 __ARGS((char_u **arg, typval_T *rettv, int evaluate)); | |
408 | +static int eval6 __ARGS((char_u **arg, typval_T *rettv, int evaluate, int want_string)); | |
409 | +static int eval7 __ARGS((char_u **arg, typval_T *rettv, int evaluate, int want_string)); | |
410 | 410 | |
411 | 411 | static int eval_index __ARGS((char_u **arg, typval_T *rettv, int evaluate, int verbose)); |
412 | 412 | static int get_option_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); |
@@ -4458,7 +4458,7 @@ | ||
4458 | 4458 | /* |
4459 | 4459 | * Get the first variable. |
4460 | 4460 | */ |
4461 | - if (eval6(arg, rettv, evaluate) == FAIL) | |
4461 | + if (eval6(arg, rettv, evaluate, FALSE) == FAIL) | |
4462 | 4462 | return FAIL; |
4463 | 4463 | |
4464 | 4464 | /* |
@@ -4494,7 +4494,7 @@ | ||
4494 | 4494 | * Get the second variable. |
4495 | 4495 | */ |
4496 | 4496 | *arg = skipwhite(*arg + 1); |
4497 | - if (eval6(arg, &var2, evaluate) == FAIL) | |
4497 | + if (eval6(arg, &var2, evaluate, op == '.') == FAIL) | |
4498 | 4498 | { |
4499 | 4499 | clear_tv(rettv); |
4500 | 4500 | return FAIL; |
@@ -4624,10 +4624,11 @@ | ||
4624 | 4624 | * Return OK or FAIL. |
4625 | 4625 | */ |
4626 | 4626 | static int |
4627 | -eval6(arg, rettv, evaluate) | |
4627 | +eval6(arg, rettv, evaluate, want_string) | |
4628 | 4628 | char_u **arg; |
4629 | 4629 | typval_T *rettv; |
4630 | 4630 | int evaluate; |
4631 | + int want_string; /* after "." operator */ | |
4631 | 4632 | { |
4632 | 4633 | typval_T var2; |
4633 | 4634 | int op; |
@@ -4641,7 +4642,7 @@ | ||
4641 | 4642 | /* |
4642 | 4643 | * Get the first variable. |
4643 | 4644 | */ |
4644 | - if (eval7(arg, rettv, evaluate) == FAIL) | |
4645 | + if (eval7(arg, rettv, evaluate, want_string) == FAIL) | |
4645 | 4646 | return FAIL; |
4646 | 4647 | |
4647 | 4648 | /* |
@@ -4676,7 +4677,7 @@ | ||
4676 | 4677 | * Get the second variable. |
4677 | 4678 | */ |
4678 | 4679 | *arg = skipwhite(*arg + 1); |
4679 | - if (eval7(arg, &var2, evaluate) == FAIL) | |
4680 | + if (eval7(arg, &var2, evaluate, FALSE) == FAIL) | |
4680 | 4681 | return FAIL; |
4681 | 4682 | |
4682 | 4683 | if (evaluate) |
@@ -4790,10 +4791,11 @@ | ||
4790 | 4791 | * Return OK or FAIL. |
4791 | 4792 | */ |
4792 | 4793 | static int |
4793 | -eval7(arg, rettv, evaluate) | |
4794 | +eval7(arg, rettv, evaluate, want_string) | |
4794 | 4795 | char_u **arg; |
4795 | 4796 | typval_T *rettv; |
4796 | 4797 | int evaluate; |
4798 | + int want_string; /* after "." operator */ | |
4797 | 4799 | { |
4798 | 4800 | long n; |
4799 | 4801 | int len; |
@@ -4838,8 +4840,10 @@ | ||
4838 | 4840 | |
4839 | 4841 | /* We accept a float when the format matches |
4840 | 4842 | * "[0-9]\+\.[0-9]\+\([eE][+-]\?[0-9]\+\)\?". This is very |
4841 | - * strict to avoid backwards compatibility problems. */ | |
4842 | - if (p[0] == '.' && vim_isdigit(p[1])) | |
4843 | + * strict to avoid backwards compatibility problems. | |
4844 | + * Don't look for a float after the "." operator, so that | |
4845 | + * ":let vers = 1.2.3" doesn't fail. */ | |
4846 | + if (!want_string && p[0] == '.' && vim_isdigit(p[1])) | |
4843 | 4847 | { |
4844 | 4848 | get_float = TRUE; |
4845 | 4849 | p = skipdigits(p + 2); |
@@ -677,6 +677,8 @@ | ||
677 | 677 | static int included_patches[] = |
678 | 678 | { /* Add new patch number below this line */ |
679 | 679 | /**/ |
680 | + 7, | |
681 | +/**/ | |
680 | 682 | 6, |
681 | 683 | /**/ |
682 | 684 | 5, |