xref: /vim-8.2.3635/runtime/compiler/ocaml.vim (revision 7e6a515e)
114b6945eSBram Moolenaar" Vim Compiler File
214b6945eSBram Moolenaar" Compiler:    ocaml
3790c18bfSBram Moolenaar" Maintainer:  Markus Mottl <[email protected]>
4*7e6a515eSBram Moolenaar" URL:         https://github.com/ocaml/vim-ocaml
5790c18bfSBram Moolenaar" Last Change:
6*7e6a515eSBram Moolenaar"              2020 Mar 28 - Improved error format (Thomas Leonard)
7790c18bfSBram Moolenaar"              2017 Nov 26 - Improved error format (Markus Mottl)
8790c18bfSBram Moolenaar"              2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
914b6945eSBram Moolenaar"
1014b6945eSBram Moolenaar" Marc Weber's comments:
1114b6945eSBram Moolenaar" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
1214b6945eSBram Moolenaar" ocamake and whatnot. So which one to use?
1314b6945eSBram Moolenaar"
1414b6945eSBram Moolenaar" This error format was moved from ftplugin/ocaml.vim to this file,
1514b6945eSBram Moolenaar" because ftplugin is the wrong file to set an error format
1614b6945eSBram Moolenaar" and the error format itself is annoying because it joins many lines in this
1714b6945eSBram Moolenaar" error case:
1814b6945eSBram Moolenaar"
1914b6945eSBram Moolenaar"    Error: The implementation foo.ml does not match the interface foo.cmi:
2014b6945eSBram Moolenaar"    Modules do not match case.
2114b6945eSBram Moolenaar"
2214b6945eSBram Moolenaar" So having it here makes people opt-in
2314b6945eSBram Moolenaar
24*7e6a515eSBram Moolenaar
2514b6945eSBram Moolenaarif exists("current_compiler")
2614b6945eSBram Moolenaar    finish
2714b6945eSBram Moolenaarendif
2814b6945eSBram Moolenaarlet current_compiler = "ocaml"
2914b6945eSBram Moolenaar
3014b6945eSBram Moolenaarlet s:cpo_save = &cpo
3114b6945eSBram Moolenaarset cpo&vim
3214b6945eSBram Moolenaar
3314b6945eSBram MoolenaarCompilerSet errorformat =
34*7e6a515eSBram Moolenaar      \%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
3514b6945eSBram Moolenaar      \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
36790c18bfSBram Moolenaar      \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
3714b6945eSBram Moolenaar      \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
3814b6945eSBram Moolenaar      \%+EReference\ to\ unbound\ regexp\ name\ %m,
3914b6945eSBram Moolenaar      \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
4014b6945eSBram Moolenaar      \%Wocamlyacc:\ w\ -\ %m,
4114b6945eSBram Moolenaar      \%-Zmake%.%#,
4214b6945eSBram Moolenaar      \%C%m,
4314b6945eSBram Moolenaar      \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
4414b6945eSBram Moolenaar      \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
4514b6945eSBram Moolenaar      \%D%*\\a:\ Entering\ directory\ `%f',
4614b6945eSBram Moolenaar      \%X%*\\a:\ Leaving\ directory\ `%f',
47790c18bfSBram Moolenaar      \%D%*\\a[%*\\d]:\ Entering\ directory\ '%f',
48790c18bfSBram Moolenaar      \%X%*\\a[%*\\d]:\ Leaving\ directory\ '%f',
49790c18bfSBram Moolenaar      \%D%*\\a:\ Entering\ directory\ '%f',
50790c18bfSBram Moolenaar      \%X%*\\a:\ Leaving\ directory\ '%f',
51790c18bfSBram Moolenaar      \%DEntering\ directory\ '%f',
52790c18bfSBram Moolenaar      \%XLeaving\ directory\ '%f',
5314b6945eSBram Moolenaar      \%DMaking\ %*\\a\ in\ %f
5414b6945eSBram Moolenaar
5514b6945eSBram Moolenaarlet &cpo = s:cpo_save
5614b6945eSBram Moolenaarunlet s:cpo_save
57