xref: /vim-8.2.3635/runtime/compiler/ocaml.vim (revision fcfe1a9b)
1" Vim Compiler File
2" Compiler:    ocaml
3" Maintainer:  Markus Mottl <[email protected]>
4" URL:         https://github.com/rgrinberg/vim-ocaml
5" Last Change:
6"              2017 Nov 26 - Improved error format (Markus Mottl)
7"              2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
8"              2013 Jun 30 - Initial version (Marc Weber)
9"
10" Marc Weber's comments:
11" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
12" ocamake and whatnot. So which one to use?
13"
14" This error format was moved from ftplugin/ocaml.vim to this file,
15" because ftplugin is the wrong file to set an error format
16" and the error format itself is annoying because it joins many lines in this
17" error case:
18"
19"    Error: The implementation foo.ml does not match the interface foo.cmi:
20"    Modules do not match case.
21"
22" So having it here makes people opt-in
23
24if exists("current_compiler")
25    finish
26endif
27let current_compiler = "ocaml"
28
29let s:cpo_save = &cpo
30set cpo&vim
31
32CompilerSet errorformat =
33      \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
34      \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
35      \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
36      \%+EReference\ to\ unbound\ regexp\ name\ %m,
37      \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
38      \%Wocamlyacc:\ w\ -\ %m,
39      \%-Zmake%.%#,
40      \%C%m,
41      \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
42      \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
43      \%D%*\\a:\ Entering\ directory\ `%f',
44      \%X%*\\a:\ Leaving\ directory\ `%f',
45      \%D%*\\a[%*\\d]:\ Entering\ directory\ '%f',
46      \%X%*\\a[%*\\d]:\ Leaving\ directory\ '%f',
47      \%D%*\\a:\ Entering\ directory\ '%f',
48      \%X%*\\a:\ Leaving\ directory\ '%f',
49      \%DEntering\ directory\ '%f',
50      \%XLeaving\ directory\ '%f',
51      \%DMaking\ %*\\a\ in\ %f
52
53let &cpo = s:cpo_save
54unlet s:cpo_save
55