Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

compiler and syntastic checker for jmacro files

  • Loading branch information...
commit 179bd4b9390f14bcc7147b508b04c63cdd5b7d0a 1 parent e76ce70
@dag authored
View
8 autoload/vim2hs/jmacro.vim
@@ -1,3 +1,11 @@
+let vim2hs#jmacro#errorformat = join([
+ \ '(line %l\, column %c):%m',
+ \ '%E(line %l\, column %c):',
+ \ '%+Cunexpected %m',
+ \ '%+Zexpecting %m'
+ \ ], ',')
+
+
function vim2hs#jmacro#keywords() " {{{
syntax keyword javaScriptFunction fun
endfunction " }}}
View
9 compiler/jmacro.vim
@@ -0,0 +1,9 @@
+if exists('current_compiler')
+ finish
+endif
+let current_compiler = 'jmacro'
+
+execute 'CompilerSet errorformat=' . escape(vim2hs#jmacro#errorformat, ' ,')
+
+CompilerSet makeprg=jmacro\ %
+CompilerSet shellpipe&
View
11 doc/vim2hs.txt
@@ -67,6 +67,17 @@ or |ftplugin| to enable a compiler only for Haskell buffers, for example:
output. This might be resolved in the future by
filtering Cabal's output through a script.
+ *quickfix-jmacro* *compiler-jmacro*
+:compiler jmacro Configure |:make| for JMacro. Requires jmacro
+ (available as jmacro from Hackage) to be installed and
+ in $PATH.
+
+ Runs the jmacro executable on the file which will show
+ the generated JavaScript on success and parse errors
+ into |quickfix| on failure.
+
+ This is not useful for QuasiQuoted JMacro code.
+
=============================================================================
TABULAR *vim2hs-tabular*
View
16 syntax_checkers/jmacro.vim
@@ -0,0 +1,16 @@
+if exists('g:loaded_jmacro_syntax_checker')
+ finish
+endif
+let g:loaded_jmacro_syntax_checker = 1
+
+if !executable('jmacro')
+ finish
+endif
+
+let s:errorformat = vim2hs#jmacro#errorformat
+
+function! SyntaxCheckers_jmacro_GetLocList() " {{{
+ let l:makeprg = 'jmacro ' . shellescape(expand('%'))
+ return SyntasticMake({'makeprg' : l:makeprg,
+ \'errorformat': s:errorformat})
+endfunction " }}}
Please sign in to comment.
Something went wrong with that request. Please try again.