'for' is skipping block when reach at 'endfor'. but it get E15(invalid 
expression) in following code.

-----
function! s:do(...)
  echomsg 's:do()'
endfunction
function! s:run()
  let obj = {'do': function('s:do')}
  for method in ['do']
    call obj[method]()
  endfor
endfunction
call s:run()
-----

vim is skipping code like following.

call
obj
['do']
...

And it return empty value when code is passing under ['do'] for 'call' 
command.
It must avoid to occur E15.

https://gist.github.com/1244902

diff -r 5e84f6567623 src/eval.c
--- a/src/eval.c Wed Sep 21 20:09:42 2011 +0200
+++ b/src/eval.c Tue Sep 27 20:39:37 2011 +0900
@@ -4013,7 +4013,7 @@
 
     p = skipwhite(arg);
     ret = eval1(&p, rettv, evaluate);
-    if (ret == FAIL || !ends_excmd(*p))
+    if (evaluate && (ret == FAIL || !ends_excmd(*p)))
     {
  if (ret != FAIL)
     clear_tv(rettv);
--

I tested followings(with change the code above to succeed, and skip line 
correctly)

  call obj[method]()
  call obj[method]().foo()
  call obj[method]() | call Foo()

Please check and include.

Thanks.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui