syntastic/syntax_checkers/coffee.vim
Martin Grenfell 62ef08d334 make a fix to the coffee checker
This is in response to #88 where errors like this were getting missed:

SyntaxError: In simpleMapComponent.js.coffee, Reserved word "function" on line 10
 at SyntaxError (unknown source)
 at Lexer.identifierError (/usr/lib/node_modules/coffee-script/lib/lexer.js:458:13)
 at Lexer.identifierToken (/usr/lib/node_modules/coffee-script/lib/lexer.js:80:16)
 at Lexer.tokenize (/usr/lib/node_modules/coffee-script/lib/lexer.js:31:19)
 at Object.compile (/usr/lib/node_modules/coffee-script/lib/coffee-script.js:29:34)
 at /usr/lib/node_modules/coffee-script/lib/command.js:149:33
 at /usr/lib/node_modules/coffee-script/lib/command.js:115:26
 at [object Object].<anonymous> (fs.js:107:5)
 at [object Object].emit (events.js:61:17)
 at afterRead (fs.js:878:12)

To fix this I have added another error matcher on the front of the
errorformat and have made a fix to the %-G matcher on the end (i.e. it
wasnt actually matching anything before).

The errorformat may need more updating.
2011-12-04 01:40:12 +00:00

28 lines
1.2 KiB
VimL

"============================================================================
"File: coffee.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Lincoln Stoll <l@lds.li>
"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("loaded_coffee_syntax_checker")
finish
endif
let loaded_coffee_syntax_checker = 1
"bail if the user doesnt have coffee installed
if !executable("coffee")
finish
endif
function! SyntaxCheckers_coffee_GetLocList()
let makeprg = 'coffee -c -l -o /tmp %'
let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction