blob: faa8af1f5f3b3878b32dff0c2ad6bef797bab558 [file] [log] [blame]
Bram Moolenaar14b69452013-06-29 23:05:20 +02001" Vim Compiler File
Bram Moolenaar790c18b2019-07-04 17:22:06 +02002" Compiler: ocaml
3" Maintainer: Markus Mottl <markus.mottl@gmail.com>
Bram Moolenaar7e6a5152021-01-02 16:39:53 +01004" URL: https://github.com/ocaml/vim-ocaml
Bram Moolenaar790c18b2019-07-04 17:22:06 +02005" Last Change:
Bram Moolenaar7e6a5152021-01-02 16:39:53 +01006" 2020 Mar 28 - Improved error format (Thomas Leonard)
Bram Moolenaar790c18b2019-07-04 17:22:06 +02007" 2017 Nov 26 - Improved error format (Markus Mottl)
8" 2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
Bram Moolenaar14b69452013-06-29 23:05:20 +02009"
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
Bram Moolenaar7e6a5152021-01-02 16:39:53 +010024
Bram Moolenaar14b69452013-06-29 23:05:20 +020025if exists("current_compiler")
26 finish
27endif
28let current_compiler = "ocaml"
29
30let s:cpo_save = &cpo
31set cpo&vim
32
33CompilerSet errorformat =
Bram Moolenaar7e6a5152021-01-02 16:39:53 +010034 \%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
Bram Moolenaar14b69452013-06-29 23:05:20 +020035 \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
Bram Moolenaar790c18b2019-07-04 17:22:06 +020036 \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
Bram Moolenaar14b69452013-06-29 23:05:20 +020037 \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
38 \%+EReference\ to\ unbound\ regexp\ name\ %m,
39 \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
40 \%Wocamlyacc:\ w\ -\ %m,
41 \%-Zmake%.%#,
42 \%C%m,
43 \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
44 \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
45 \%D%*\\a:\ Entering\ directory\ `%f',
46 \%X%*\\a:\ Leaving\ directory\ `%f',
Bram Moolenaar790c18b2019-07-04 17:22:06 +020047 \%D%*\\a[%*\\d]:\ Entering\ directory\ '%f',
48 \%X%*\\a[%*\\d]:\ Leaving\ directory\ '%f',
49 \%D%*\\a:\ Entering\ directory\ '%f',
50 \%X%*\\a:\ Leaving\ directory\ '%f',
51 \%DEntering\ directory\ '%f',
52 \%XLeaving\ directory\ '%f',
Bram Moolenaar14b69452013-06-29 23:05:20 +020053 \%DMaking\ %*\\a\ in\ %f
54
55let &cpo = s:cpo_save
56unlet s:cpo_save