]> git.r.bdr.sh - rbdr/dotfiles/blame - vim/syntax_checkers/fortran.vim
Remove backup and DS_Store
[rbdr/dotfiles] / vim / syntax_checkers / fortran.vim
CommitLineData
0d23b6e5
BB
1"============================================================================
2"File: fortran.vim
3"Description: Syntax checking plugin for syntastic.vim
4"Maintainer: Karl Yngve LervÄg <karl.yngve@lervag.net>
5"License: This program is free software. It comes without any warranty,
6" to the extent permitted by applicable law. You can redistribute
7" it and/or modify it under the terms of the Do What The Fuck You
8" Want To Public License, Version 2, as published by Sam Hocevar.
9" See http://sam.zoy.org/wtfpl/COPYING for more details.
10"Note: This syntax checker uses gfortran with the option -fsyntax-only
11" to check for errors and warnings. Additional flags may be
12" supplied through both local and global variables,
13" b:syntastic_fortran_flags,
14" g:syntastic_fortran_flags.
15" This is particularly useful when the source requires module files
16" in order to compile (that is when it needs modules defined in
17" separate files).
18"
19"============================================================================
20
21if exists("loaded_fortran_syntax_checker")
22 finish
23endif
24let loaded_fortran_syntax_checker = 1
25
26"bail if the user doesnt have fortran installed
27if !executable("gfortran")
28 finish
29endif
30
31if !exists('g:syntastic_fortran_flags')
32 let g:syntastic_fortran_flags = ''
33endif
34
35function! SyntaxCheckers_fortran_GetLocList()
36 let makeprg = 'gfortran -fsyntax-only'
37 let makeprg .= g:syntastic_fortran_flags
38 if exists('b:syntastic_fortran_flags')
39 let makeprg .= b:syntastic_fortran_flags
40 endif
41 let makeprg .= ' ' . shellescape(expand('%'))
42 let errorformat = '%-C %#,%-C %#%.%#,%A%f:%l.%c:,%Z%m,%G%.%#'
43 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
44endfunction