Open Kuniwak opened 7 years ago
This is impossible to parse.
function! s:foo()
let let s:inline_python = 'echo "I love python"'
endfunction
let s:inline_python = 'python << EOF'
call s:foo()
exec s:inline_python
import os
EOF
In this case, import os
should be parsed as VimL not python.
But the following could be supported:
let cmd_exec = 'python3'
execute 'command! -nargs=1 PythonJedi '.cmd_exec.' <args>'
PythonJedi << EOF
try:
import foo
except Exception as excinfo:
pass
EOF
From a quick look this would require "only" to handle the heredoc for user commands, which is currently done in parse_cmd_lua
: https://github.com/Kuniwak/vint/blob/f78b0f034a70aa2d39130f6c5a3a21c6c61683e2/vint/_bundles/vimlparser.py#L1106
vim-vimlparse cannot parse the script, but Vim can run it well:
And it raises the following error: