diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index 27a3bd085..75d8b7c51 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -65,6 +65,7 @@ let s:_DEFAULT_CHECKERS = { \ 'po': ['msgfmt'], \ 'pod': ['podchecker'], \ 'puppet': ['puppet', 'puppetlint'], + \ 'purescript': ['pulp'], \ 'python': ['python', 'flake8', 'pylint'], \ 'qml': ['qmllint'], \ 'r': [], diff --git a/syntax_checkers/purescript/pulp.vim b/syntax_checkers/purescript/pulp.vim new file mode 100644 index 000000000..743dd6be2 --- /dev/null +++ b/syntax_checkers/purescript/pulp.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: pulp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sean Hess +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('g:loaded_syntastic_purescript_pulp_checker') + finish +endif +let g:loaded_syntastic_purescript_pulp_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_purescript_pulp_GetLocList() dict + + let makeprg = self.makeprgBuild({ + \ 'exe_after': 'build --main ', + \ 'fname': syntastic#util#shexpand('%:p') }) + + let errorformat = + \ '%E\\s%#psc: %m,' . + \ '%C\\s%#at \"%f\" \(line %l\, column %c\)%.%#,' . + \ '%E\\s%#\"%f\" \(line %l\, column %c\)%.%#,' . + \ '%E%.%#Error at %f line %l\, column %c - %.%#,'. + \ '%-G\* ERROR: Subcommand%.%#,' . + \ '\* ERROR: %m,' . + \ '%Z\\s%#See http%.%#,' . + \ '%C\\s%#%m,' . + \ '%Z' + + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'purescript', + \ 'name': 'pulp'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: