python is added to cf5.

This commit is contained in:
2014-06-10 01:24:30 +04:00
parent c7685d2756
commit 782450c744

View File

@@ -58,6 +58,24 @@ function! s:CompileJava(run) "{{{2
echo eout
endfunction
function! s:InterpretPython(run) "{{{2
" Interpret it
let cmd = "python " . g:pyflags . " " . expand("%")
echo cmd
let cout = system( cmd )
echo cout
if v:shell_error
return
endif
" run it
"let classpath=expand("%:p:r")
"let exename=expand("%:r")
"let cmd = "java " . exename . " " . g:argv
"echo cmd
"let eout = system( cmd )
"echo eout
endfunction
function! s:CompileWindows(run) "{{{2
let ext=expand("%:e")
if ext=="java"
@@ -66,6 +84,12 @@ function! s:CompileWindows(run) "{{{2
if ext=="cpp"
call s:CompileMSVC(a:run)
endif
if ext=="c"
call s:CompileMSVC(a:run)
endif
if ext=="py"
call s:InterpretPython(a:run)
endif
endfunction
"
@@ -93,7 +117,19 @@ function! s:CompileGCC(run) "{{{2
endfunction
function! s:CompileLinux(run) "{{{2
call s:CompileGCC(a:run)
let ext=expand("%:e")
if ext=="java"
call s:CompileJava(a:run)
endif
if ext=="cpp"
call s:CompileGCC(a:run)
endif
if ext=="c"
call s:CompileGCC(a:run)
endif
if ext=="py"
call s:InterpretPython(a:run)
endif
endfunction
"
@@ -154,6 +190,7 @@ endfunction
function! s:initDefaults()
let g:cf5output=0
let g:argv=""
let g:pyflags=""
let g:cppflags=""
let g:wcppflags="/O2 /EHsc /DWIN32"
let g:lcppflags="-O2"