Mercury checker: cleanup.

This commit is contained in:
LCD 47 2015-03-19 08:33:54 +02:00
parent 4e0ac804cf
commit b905f6d08a
4 changed files with 27 additions and 21 deletions

View File

@ -58,9 +58,9 @@ C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D,
Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL,
Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX,
LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB,
NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Mercury, NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext
Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG, Portable Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax
reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Tcl, TeX, NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Tcl, TeX,
Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC,
YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details about YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details about
the corresponding supported checkers. the corresponding supported checkers.

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.6.0-59' let g:_SYNTASTIC_VERSION = '3.6.0-62'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -53,6 +53,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'lua': ['luac'], \ 'lua': ['luac'],
\ 'markdown': ['mdl'], \ 'markdown': ['mdl'],
\ 'matlab': ['mlint'], \ 'matlab': ['mlint'],
\ 'mercury': ['mmc'],
\ 'nasm': ['nasm'], \ 'nasm': ['nasm'],
\ 'nroff': ['mandoc'], \ 'nroff': ['mandoc'],
\ 'objc': ['gcc'], \ 'objc': ['gcc'],

View File

@ -1,9 +1,13 @@
"============================================================================ "============================================================================
"File: mercury.vim "File: mercury.vim
"Description: Syntax checking plugin for syntastic.vim "Description: Syntax checking plugin for syntastic.vim
" Based off of the hlint syntax checker. "Maintainer: Joshua Rahm (joshuarahm@gmail.com)
"Maintainer: Josh Rahm (joshuarahm@gmail.com) "License: This program is free software. It comes without any warranty,
"License: WTF " 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_mercury_mmc_checker') if exists('g:loaded_syntastic_mercury_mmc_checker')
@ -11,27 +15,28 @@ if exists('g:loaded_syntastic_mercury_mmc_checker')
endif endif
let g:loaded_syntastic_mercury_mmc_checker = 1 let g:loaded_syntastic_mercury_mmc_checker = 1
if !exists('g:syntastic_mercury_compiler_options')
let g:syntastic_mercury_compiler_options=''
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_mercury_mmc_GetLocList() dict function! SyntaxCheckers_mercury_mmc_GetLocList() dict
let makeprg = self.makeprgBuild({ let makeprg = self.makeprgBuild({ 'args_before': '-e' })
\ 'exe': self.getExecEscaped() . ' -e ' . g:syntastic_mercury_compiler_options})
let errorformat = let errorformat =
\ '%E%f:%l: error:%m,' . \ '%C%f:%l: %m,' .
\ '%E%f:%l: Error:%m,' . \ '%E%f:%l: %m,' .
\ '%W%f:%l: warning:%m,' . \ '%-G%.%#'
\ '%E%f:%l: mode error:%m'
return SyntasticMake({ let loclist = SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat })
\ 'postprocess': ['compressWhitespace'] })
for e in loclist
if stridx(e['text'], ' warning:') >= 0
let e['type'] = 'W'
endif
endfor
return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
@ -41,4 +46,4 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set sw=4 sts=4 et fdm=marker: