qx13468 28d94f21ed trunk eingeführt
git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@133 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
2007-04-12 15:34:18 +00:00

206 lines
5.9 KiB
VimL
Raw Blame History

" Vim compiler file
" Compiler: diab data 4.4
" Maintainer: Stefan Liebl
" Last Change: 13.06.2002
"if exists('current_compiler')
" finish
"endif
"let current_compiler = 'bcc'
set errorformat=
" tex-errorformat laden
let b:forceRedoTexCompiler = 'yes'
let g:Tex_ShowallLines = 1
"execute 'source ' . expand(g:vimfiles . '/compiler/tex.vim')
let g:makeprg = simplify(GetBmskDir() . '/make_fsw.bat')
let &makeprg = g:makeprg . ' $*'
if exists('g:make_log')
let &shellpipe = '| ' . g:tee . PathNormpath(make_log) . ' | ' . g:tee
else
let &shellpipe = '| ' . g:tee
endif
set makeef=
" -------------------------------------
" Diab-Data-Compiler, Assembler, Linker
" -------------------------------------
" dcc_info, dcc_warning, dcc_error, dcc_fatal
setlocal errorformat+=\"%f\"\\,\ line\ %l:\ %t%.%#\ \(dcc:%n\):%m
" dcc_fatal
setlocal errorformat+=\"%f\"\\,\ line\ %l:\ %tatal\ error\ \(dcc:%n\):%m
setlocal errorformat+=%tatal\ error\ \(dcc:%n\):%m
" das_error
setlocal errorformat+=\"%f\"\\,\ line\ %l:\ %t[a-z]:%m
" dld_error
setlocal errorformat+=d%td:%m
setlocal errorformat+=d%td.EXE:%m
" -------
" PC-Lint
" -------
setlocal errorformat+=\"%f\"\\,\ line\ %l:\ %t%.%#\ \(pclint:%n\):%m
setlocal errorformat+=%t%.%#\ \(pclint:%n\):%m
" -------
" SP-Lint
" -------
"setlocal errorformat+=%f\(%l,%c\):\ %m
setlocal errorformat+=%A%f\(%l\):\ %m
setlocal errorformat+=%A%f\(%l\):
setlocal errorformat+=%A%f\(%l\\,%c\):\ %m
setlocal errorformat+=%A%f\(%l\\,%c\):
setlocal errorformat+=%C\ \ \ \ %m
" --------
" GNU-Make
" --------
setlocal errorformat+=%f:%l:\ %m
setlocal errorformat+=%f:%l:%t%.%#:\ %m
setlocal errorformat+=%+G%.%#make.exe:\ %m
setlocal errorformat+=%+G%.%#make%.%#.sh:\ %m
setlocal errorformat+=%+G%.%#mkdir.exe:\ %m
setlocal errorformat+=%+G%.%#cp.exe:\ %m
setlocal errorformat+=%+G%.%#rm.exe:\ %m
" ---------
" BMSK make
" ---------
setlocal errorformat+=bmsk:\ %m
" ------------
" python error
" ------------
setlocal errorformat+=%+G%.%#python.exe:\ %m
"setlocal errorformat+=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
" -----
" DAMOS
" -----
" Damos error
setlocal errorformat +=%PDAM-S-INPUTFILEOPENED\ %f%*\\s
setlocal errorformat +=%PDAM-S-OUTPUTFILEOPENED\ %f%*\\s
setlocal errorformat +=%QDAM-S-FILECLOSED\ %f%*\\s
"setlocal errorformat +=%PDAM-S-OSP-OPENING-SEQ-OSP\ %f%*\\s
setlocal errorformat +=%QDAM-S-OSP-CLOSE\ %f%*\\s
" ignore 'DAM-W-KONS-SW-IGNORED'
setlocal errorformat+=%-O%.%#DAM-W-KONS-SW-IGNORED
" Damos Info-Feld
"setlocal errorformat +=%-I\|\ DAM-I-%m,
" \%-Z+-%#
" Damos Warning- oder Error-Feld
" DAM-W-...
setlocal errorformat +=%A\ %#\|\ DAM-%t-%m,
\%C\ %#\|\%*\\sZeile\ %l%m,
\%C\ %#\|\%*\\sZeile\ %f:\ %l%m,
\%C\ %#\|\ %#%m,
\%-Z\ %#+-%#
" Damos: Kenngr<67><72>en, die in mehr als einer SG-Funktion definiert sind:
" Kgs: ... Fkt: ...
setlocal errorformat +=%+WKenngr<EFBFBD><EFBFBD>en%m
setlocal errorformat +=%+WKgs:%m
" Damos: Ram-Gr<47><72>en, die in einer SG-Funktion enthalten sind,
" aber nicht im OSp existieren:
" Ram: ... Fkt: ...
setlocal errorformat +=%+WRam-Gr<EFBFBD><EFBFBD>en%m,
\%+Zaber%m
" Damos: Lokale Ram-Gr<47><72>en, die referenziert werden:
" Ram: ... Fkt: ...
setlocal errorformat +=%+WLokale\ Ram-Gr<EFBFBD><EFBFBD>en%m
setlocal errorformat +=%+WRam:%m
"
setlocal errorformat +=%W%\\%#%#DAM-S-KGR-PLS-EXCEEDED%m:%*\\s,
\%CDAM-S-KGR-PLS-EXCEEDED%m,
\%-Z+-%#
" ignore uninterresting lines
" ---------------------------
" ignore 'ignoring option ...'
setlocal errorformat+=%-Oignoring\ option%.%#
" ignore 'file: 123: #error ...'
setlocal errorformat+=%-O%*\\S\ %*\\d:\ #%.%#
" make options
let g:makeopts = ''
if (g:Motor != '')
let g:makeopts = g:makeopts . ' Motor=' . g:Motor
endif
if (g:Muster != '')
let g:makeopts = g:makeopts . ' Muster=' . Muster
endif
if (g:Egas != '')
let g:makeopts = g:makeopts . ' Egas=' . g:Egas
endif
if (Xlint != '')
let g:makeopts = g:makeopts . ' DIAB_LINT_OPTION=' . Xlint
endif
if (g:SW_Stand != '')
let g:makeopts = g:makeopts . ' Stand=' . g:SW_Stand
endif
" user commands
command! -nargs=* Make execute(':make! <args> ' . g:makeopts)
command! -nargs=0 Clean call Clean()
command! -nargs=0 CleanAll call CleanAll()
command! Compile call Compile_File()
command! PreCompile call PreCompile_File()
" Clean function
function! Clean()
Make clean
endfunction
function! CleanAll()
cscope kill -1
Make cleanall
endfunction
" reformat i-file
command! ReformatIFile call Reformat_IFile()
function! Reformat_IFile() abort
let cName = expand('%:t:r') . '.c'
let CR = '\<CR>'
DelAllMultipleEmptyLines
" do not wrap over end of file
setlocal nowrapscan
" go to top of file
execute 'normal gg'
" do unil error
while 1
" delete until line of c-file
execute 'normal d/\c^# \d\+ ".*\(' . cName . '\)' . CR
" go to line of include-file
execute 'normal /\c^# \d\+ ".*\(' . cName . '\)\@<!"' . CR
endwhile
endfunction
function! GetMakeVar(varName)
let var = GetMakeVars([a:varName])
if has_key(var, a:varName)
let varValue = var[a:varName]
else
let varValue = ''
endif
return varValue
endfunction
function! GetMakeVars(varNameList)
let varlist = {}
try
let vars = join(a:varNameList, ' ')
let command = g:makeprg . g:makeopts . ' getvar name="' . vars . '"'
let output = system(command)
let lines = split(output, "\n")
if len(lines) == 1
" make < make-43 (Antwort nur VALUE)
let RE = '\(.*\)'
let SU = "let varlist['" . vars . "']='\\1'"
else
" make >= make-43 (Antwort: NAME=VALUE
let RE = '^\(\w\+\)=\(.*\)\s*'
let SU = "let varlist['\\1']='\\2'"
endif
for line in lines
if match(line, RE) >= 0
execute substitute(line, RE, SU, '')
endif
endfor
endtry
return varlist
endfunction