annotate runtime/compiler/ocaml.vim @ 16024:7fd3a9eaeedb v8.1.1017

patch 8.1.1017: off-by-one error in filetype detection commit https://github.com/vim/vim/commit/493fbe4abee660d30b4f2aef87b754b0a720213c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 17 17:16:12 2019 +0100 patch 8.1.1017: off-by-one error in filetype detection Problem: Off-by-one error in filetype detection. Solution: Also check the last line of the file.
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 Mar 2019 17:30:14 +0100
parents c458ff35497e
children 432714f5c0f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5055
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim Compiler File
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Compiler: ocaml
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: See ftplugin/ocaml.vim (?)
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Last Change: June 2013 by Marc Weber
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 "
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " Marc Weber's comments:
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " ocamake and whatnot. So which one to use?
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 "
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 " This error format was moved from ftplugin/ocaml.vim to this file,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 " because ftplugin is the wrong file to set an error format
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 " and the error format itself is annoying because it joins many lines in this
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 " error case:
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 "
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 " Error: The implementation foo.ml does not match the interface foo.cmi:
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 " Modules do not match case.
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 "
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 " So having it here makes people opt-in
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 if exists("current_compiler")
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 finish
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 endif
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 let current_compiler = "ocaml"
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 let s:cpo_save = &cpo
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 set cpo&vim
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 CompilerSet errorformat =
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 \%+EReference\ to\ unbound\ regexp\ name\ %m,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 \%Wocamlyacc:\ w\ -\ %m,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 \%-Zmake%.%#,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 \%C%m,
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 \%D%*\\a:\ Entering\ directory\ `%f',
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 \%X%*\\a:\ Leaving\ directory\ `%f',
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 \%DMaking\ %*\\a\ in\ %f
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 let &cpo = s:cpo_save
c458ff35497e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 unlet s:cpo_save