Checker iasl: cleanup.

This commit is contained in:
LCD 47 2016-07-31 18:45:34 +03:00
parent 0377d09346
commit 85666799bb
3 changed files with 32 additions and 57 deletions

View File

@ -55,21 +55,21 @@ can be done on demand, or automatically as files are saved. If syntax errors
are detected, the user is notified and is happy because they didn't have to
compile their code or execute their script to find them.
At the time of this writing, syntastic has checking plugins for ActionScript,
Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, Assembly
languages, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript,
Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, 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, Mercury, NASM, Nix,
Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable
Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python,
QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec,
Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo,
Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery,
YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the
[manual][checkers] for details about the corresponding supported checkers
(`:help syntastic-checkers` in Vim).
At the time of this writing, syntastic has checking plugins for ACPI
Source Language, ActionScript, Ada, Ansible configurations, API Blueprint,
AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C,
C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart,
DocBook, Dockerfile, Dust, 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, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl
POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug (formerly
Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax NG,
reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL,
Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml,
XML, XSLT, XQuery, YACC, YAML, YANG data models, z80, Zope page templates, and
Zsh. See the [manual][checkers] for details about the corresponding supported
checkers (`:help syntastic-checkers` in Vim).
A number of third-party Vim plugins also provide checkers for syntastic, for
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],

View File

@ -147,18 +147,16 @@ The following checkers are available for the ACPI Source Language (filetype
Name: iasl
Maintainer: Peter Wu <peter@lekensteyn.nl>
"iasl" is a compiler/decompiler for ACPI Source Language(ASL) and ACPI Machine
Language (AML). See the project's page for details:
https://acpica.org/
Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|.
Additionally:
*'g:syntastic_asl_iasl_delete_output'*
Type: boolean
Default: 1
When set the checker will delete the ".aml" files created by "iasl".
Note~
You probably also need a plugin to set |filetype| for ASL files, such as

View File

@ -1,6 +1,6 @@
"============================================================================
"File: iasl.vim
"Description: Syntax checking plugin for syntastic.vim using iasl
"Description: Syntax checking plugin for syntastic using iasl
"Maintainer: Peter Wu <peter@lekensteyn.nl>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
@ -17,30 +17,12 @@ let g:loaded_syntastic_asl_iasl_checker = 1
let s:save_cpo = &cpo
set cpo&vim
" Checker options {{{1
function! SyntaxCheckers_asl_iasl_GetLocList() dict
let tmpdir = syntastic#util#tmpdir()
let makeprg = self.makeprgBuild({
\ 'args': '-vi',
\ 'args_after': '-p ' . tmpdir })
if !exists('g:syntastic_asl_iasl_delete_output')
let g:syntastic_asl_iasl_delete_output = 1
endif
" }}}1
function! SyntaxCheckers_asl_iasl_GetLocList() dict " {{{1
" Enable less verbose messages for use with IDES (MSVC style).
let iasl_opts = '-vi'
let output_dir = ''
if g:syntastic_asl_iasl_delete_output
let output_dir = syntastic#util#tmpdir()
let iasl_opts .= ' -p' . syntastic#util#shescape(output_dir)
endif
let makeprg = self.makeprgBuild({ 'args_after': iasl_opts })
" See source/compiler/aslmessages.c for functions that produce output:
" AePrintException, called via AslCommonError, via AslError.
" "%s(%u) : %s" filename, line no, message without ID
" "%s(%u) : %s %4.4d - %s" filename, line no, level, exception code, msg
let errorformat =
\ '%f(%l) : %trror %n - %m,' .
\ '%f(%l) : %tarning %n - %m,' .
@ -48,29 +30,24 @@ function! SyntaxCheckers_asl_iasl_GetLocList() dict " {{{1
\ '%f(%l) : %tptimize %n - %m,' .
\ '%f(%l) : %m'
if output_dir !=# ''
silent! call mkdir(output_dir, 'p')
endif
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0, 255] })
" Change Remark comments to Warnings. Optimization comments are normally not
" reported unless '-vo' is added to the iasl options.
for e in loclist
if e['type'] =~? 'r' || e['type'] =~? 'o'
if e['type'] =~? 'r'
let e['type'] = 'W'
elseif e['type'] =~? 'o'
let e['type'] = 'W'
let e['subtype'] = 'Style'
endif
endfor
if output_dir !=# ''
call syntastic#util#rmrf(output_dir)
endif
call syntastic#util#rmrf(tmpdir)
return loclist
endfunction "}}}1
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'asl',