From 2a07c4acd9a54f44960d8457cc7cf095833af3c8 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Mon, 23 Feb 2015 15:31:09 +0200 Subject: [PATCH] New checker for SML: smlnj. --- README.markdown | 4 +-- plugin/syntastic.vim | 2 +- plugin/syntastic/registry.vim | 1 + syntax_checkers/sml/smlnj.vim | 47 +++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 syntax_checkers/sml/smlnj.vim diff --git a/README.markdown b/README.markdown index aae456aa..9c7f175d 100644 --- a/README.markdown +++ b/README.markdown @@ -59,8 +59,8 @@ Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and -iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, -RPM spec, Ruby, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, +iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM +spec, Ruby, SASS/SCSS, Scala, Slim, SML, Tcl, TeX, 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 the corresponding supported checkers. A number of third party Vim plugins also provide checking diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 45bb0165..b4c8f126 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.6.0-38' +let g:_SYNTASTIC_VERSION = '3.6.0-40' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index be597c56..88d41db6 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -73,6 +73,7 @@ let s:_DEFAULT_CHECKERS = { \ 'scss': ['sass', 'scss_lint'], \ 'sh': ['sh', 'shellcheck'], \ 'slim': ['slimrb'], + \ 'sml': ['smlnj'], \ 'spec': ['rpmlint'], \ 'tcl': ['nagelfar'], \ 'tex': ['lacheck', 'chktex'], diff --git a/syntax_checkers/sml/smlnj.vim b/syntax_checkers/sml/smlnj.vim new file mode 100644 index 00000000..0c749a4a --- /dev/null +++ b/syntax_checkers/sml/smlnj.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: smlnj.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"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_sml_smlnj_checker") + finish +endif +let g:loaded_syntastic_sml_smlnj_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_sml_smlnj_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = + \ '%E%f:%l%\%.%c %trror: %m,' . + \ '%E%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %trror: %m,' . + \ '%W%f:%l%\%.%c %tarning: %m,' . + \ '%W%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %tarning: %m,' . + \ '%C%\s%\+%m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'], + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sml', + \ 'name': 'smlnj', + \ 'exec': 'sml'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: