1 "============================================================================
3 "Description: Syntax checking plugin for syntastic.vim
4 "Maintainer: David Bernard <david.bernard.31 at gmail dot com>
5 "License: This program is free software. It comes without any warranty,
6 " to the extent permitted by applicable law. You can redistribute
7 " it and/or modify it under the terms of the Do What The Fuck You
8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
11 "============================================================================
12 if exists("loaded_haxe_syntax_checker")
15 let loaded_haxe_syntax_checker = 1
17 "bail if the user doesn't have haxe installed
18 if !executable("haxe")
23 " find the file argument and returns the path to it.
24 " Starting with the current working dir, it walks up the parent folders
25 " until it finds the file, or it hits the stop dir.
26 " If it doesn't find it, it returns "Nothing"
27 function! s:FindInParent(fln,flsrt,flstp)
29 while ( strlen( here) > 0 )
30 let p = split(globpath(here, a:fln), '\n')
32 return ['ok', here, fnamemodify(p[0], ':p:t')]
34 let fr = match(here, '/[^/]*$')
38 let here = strpart(here, 0, fr)
43 return ['fail', '', '']
46 function! SyntaxCheckers_haxe_GetLocList()
47 let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/')
49 let makeprg = 'cd ' . hxmldir . '; haxe ' . hxmlname
50 let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m'
51 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
53 return SyntasticMake({})