annotate runtime/syntax/ocaml.vim @ 31996:ca6bc7c04163 v9.0.1330

patch 9.0.1330: handling new value of an option has a long "else if" chain Commit: https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Feb 20 12:16:39 2023 +0000 patch 9.0.1330: handling new value of an option has a long "else if" chain Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/12015)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Feb 2023 13:30:05 +0100
parents 15fa3923cc49
children 7270e1122962
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: OCaml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Filenames: *.ml *.mli *.mll *.mly
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
4 " Maintainers: Markus Mottl <markus.mottl@gmail.com>
20
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
5 " Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de>
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 7
diff changeset
6 " Issac Trotts <ijtrotts@ucdavis.edu>
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
7 " URL: https://github.com/ocaml/vim-ocaml
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
8 " Last Change:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
9 " 2018 Nov 08 - Improved highlighting of operators (Maëlan)
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
10 " 2018 Apr 22 - Improved support for PPX (Andrey Popp)
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
11 " 2018 Mar 16 - Remove raise, lnot and not from keywords (Étienne Millon, "copy")
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
12 " 2017 Apr 11 - Improved matching of negative numbers (MM)
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
13 " 2016 Mar 11 - Improved support for quoted strings (Glen Mével)
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
14 " 2015 Aug 13 - Allow apostrophes in identifiers (Jonathan Chan, Einar Lielmanis)
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
15 " 2015 Jun 17 - Added new "nonrec" keyword (MM)
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
16
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
17 " A minor patch was applied to the official version so that object/end
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
18 " can be distinguished from begin/end, which is used for indentation,
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
19 " and folding. (David Baelde)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
21 " Quit when a syntax file was already loaded
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
22 if exists("b:current_syntax") && b:current_syntax == "ocaml"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
26 let s:keepcpo = &cpo
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
27 set cpo&vim
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
28
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
29 " ' can be used in OCaml identifiers
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
30 setlocal iskeyword+='
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
31
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
32 " ` is part of the name of polymorphic variants
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
33 setlocal iskeyword+=`
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
34
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " OCaml is case sensitive.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
38 " Access to the method of an object
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
39 syn match ocamlMethod "#"
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
40
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Script headers highlighted like comments
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
42 syn match ocamlComment "^#!.*" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Scripting directives
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
45 syn match ocamlScript "^#\<\(quit\|labels\|warnings\|warn_error\|directory\|remove_directory\|cd\|load\|load_rec\|use\|mod_use\|install_printer\|remove_printer\|require\|list\|ppx\|principal\|predicates\|rectypes\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\|camlp4r\|topfind_log\|topfind_verbose\)\>"
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 826
diff changeset
46
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " lowercase identifier - the standard way to match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match ocamlKeyChar "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " Errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match ocamlBraceErr "}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match ocamlBrackErr "\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match ocamlParenErr ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match ocamlArrErr "|]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match ocamlCommentErr "\*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match ocamlCountErr "\<downto\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match ocamlCountErr "\<to\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match ocamlDoErr "\<do\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match ocamlDoneErr "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn match ocamlThenErr "\<then\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Error-highlighting of "end" without synchronization:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " as keyword or as error (default)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 if exists("ocaml_noend_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match ocamlKeyword "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match ocamlEndErr "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " Some convenient clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
83 syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " Enclosing delimiters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " Comments
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
94 syn region ocamlComment start="(\*" end="\*)" contains=@Spell,ocamlComment,ocamlTodo
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
95 syn keyword ocamlTodo contained TODO FIXME XXX NOTE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " Objects
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
99 syn region ocamlEnd matchgroup=ocamlObject start="\<object\>" matchgroup=ocamlObject end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " Blocks
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn region ocamlEnd matchgroup=ocamlKeyword start="\<begin\>" matchgroup=ocamlKeyword end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " "for"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn region ocamlNone matchgroup=ocamlKeyword start="\<for\>" matchgroup=ocamlKeyword end="\<\(to\|downto\)\>" contains=ALLBUT,@ocamlContained,ocamlCountErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " "do"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn region ocamlDo matchgroup=ocamlKeyword start="\<do\>" matchgroup=ocamlKeyword end="\<done\>" contains=ALLBUT,@ocamlContained,ocamlDoneErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 " "if"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 syn region ocamlNone matchgroup=ocamlKeyword start="\<if\>" matchgroup=ocamlKeyword end="\<then\>" contains=ALLBUT,@ocamlContained,ocamlThenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
120 "" PPX nodes
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
121
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
122 syn match ocamlPpxIdentifier /\(\[@\{1,3\}\)\@<=\w\+\(\.\w\+\)*/
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
123 syn region ocamlPpx matchgroup=ocamlPpxEncl start="\[@\{1,3\}" contains=TOP end="\]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 "" Modules
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 " "sig"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
128 syn region ocamlSig matchgroup=ocamlSigEncl start="\<sig\>" matchgroup=ocamlSigEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 syn region ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 " "open"
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
132 syn match ocamlKeyword "\<open\>" skipwhite skipempty nextgroup=ocamlFullMod
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 " "include"
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
135 syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " "module" - somewhat complicated stuff ;-)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
139 syn region ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
140 syn region ocamlModParam start="([^*]" end=")" contained contains=ocamlGenMod,ocamlModParam1,ocamlSig,ocamlVal
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
141 syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
142 syn match ocamlGenMod "()" contained skipwhite skipempty
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 syn region ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
145 syn region ocamlMPRestr1 matchgroup=ocamlSigEncl start="\ssig\s\=" matchgroup=ocamlSigEncl end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
146 syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
147 syn match ocamlMPRestr3 "\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
149 syn keyword ocamlKeyword val
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
150 syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment,ocamlFullMod skipwhite skipempty nextgroup=ocamlMPRestr
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
151 syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
152 syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
154 syn region ocamlFuncWith start="([^*)]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
155 syn region ocamlFuncStruct matchgroup=ocamlStructEncl start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
157 syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn region ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
159 syn match ocamlWith "\<\(\u\(\w\|'\)* *\. *\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
162 " "struct"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
163 syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
164
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 " "module type"
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
166 syn region ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
167 syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
169 " Quoted strings
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
170 syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{\z\([a-z_]*\)|" end="|\z1}" contains=@Spell
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
171
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 syn keyword ocamlKeyword and as assert class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 syn keyword ocamlKeyword constraint else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 syn keyword ocamlKeyword exception external fun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 syn keyword ocamlKeyword in inherit initializer
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
177 syn keyword ocamlKeyword lazy let match
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
178 syn keyword ocamlKeyword method mutable new nonrec of
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
179 syn keyword ocamlKeyword parser private rec
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 syn keyword ocamlKeyword try type
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
181 syn keyword ocamlKeyword virtual when while with
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 if exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 syn keyword ocamlKeyword do value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 syn keyword ocamlBoolean True False
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 syn keyword ocamlKeyword function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 syn keyword ocamlBoolean true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
191 syn keyword ocamlType array bool char exn float format format4
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
192 syn keyword ocamlType int int32 int64 lazy_t list nativeint option
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
193 syn keyword ocamlType bytes string unit
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn match ocamlConstructor "(\s*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn match ocamlConstructor "\[\s*\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 syn match ocamlConstructor "\[|\s*>|]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 syn match ocamlConstructor "\[<\s*>\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 syn match ocamlConstructor "\u\(\w\|'\)*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 " Polymorphic variants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 syn match ocamlConstructor "`\w\(\w\|'\)*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 " Module prefix
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
205 syn match ocamlModPath "\u\(\w\|'\)* *\."he=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 syn match ocamlCharacter "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'"
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
208 syn match ocamlCharacter "'\\x\x\x'"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn match ocamlCharErr "'\\[^\'ntbr]'"
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
211 syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 syn match ocamlTopStop ";;"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 syn match ocamlAnyVar "\<_\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 syn match ocamlKeyChar "|[^\]]"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 syn match ocamlKeyChar ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 syn match ocamlKeyChar "\~"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 syn match ocamlKeyChar "?"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
220
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
221 "" Operators
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
223 " The grammar of operators is found there:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
224 " https://caml.inria.fr/pub/docs/manual-ocaml/names.html#operator-name
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
225 " https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:ext-ops
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
226 " https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:index-operators
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
227 " =, *, < and > are both operator names and keywords, we let the user choose how
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
228 " to display them (has to be declared before regular infix operators):
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
229 syn match ocamlEqual "="
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
230 syn match ocamlStar "*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
231 syn match ocamlAngle "<"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
232 syn match ocamlAngle ">"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
233 " Custom indexing operators:
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
234 syn region ocamlIndexing matchgroup=ocamlIndexingOp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
235 \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*("
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
236 \ end=")\(\_s*<-\)\?"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
237 \ contains=ALLBUT,@ocamlContained,ocamlParenErr
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
238 syn region ocamlIndexing matchgroup=ocamlIndexingOp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
239 \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*\["
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
240 \ end="]\(\_s*<-\)\?"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
241 \ contains=ALLBUT,@ocamlContained,ocamlBrackErr
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
242 syn region ocamlIndexing matchgroup=ocamlIndexingOp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
243 \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*{"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
244 \ end="}\(\_s*<-\)\?"
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
245 \ contains=ALLBUT,@ocamlContained,ocamlBraceErr
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
246 " Extension operators (has to be declared before regular infix operators):
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
247 syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
248 " Infix and prefix operators:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
249 syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
250 syn match ocamlPrefixOp "[~?][~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
251 syn match ocamlInfixOp "[&$%@^/+-][~?!.:|&$%<=>@^*/+-]*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
252 syn match ocamlInfixOp "[|<=>*][~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
253 syn match ocamlInfixOp "#[~?!.:|&$%<=>@^*/+-]\+#\@!"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
254 syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
255 syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
256 " := is technically an infix operator, but we may want to show it as a keyword
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
257 " (somewhat analogously to = for let‐bindings and <- for assignations):
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
258 syn match ocamlRefAssign ":="
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
259 " :: is technically not an operator, but we may want to show it as such:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
260 syn match ocamlCons "::"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
261 " -> and <- are keywords, not operators (but can appear in longer operators):
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
262 syn match ocamlArrow "->[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 if exists("ocaml_revised")
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
264 syn match ocamlErr "<-[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 else
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
266 syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
269 syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
270 syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
271 syn match ocamlNumber "-\=\<0[o|O]\(\o\|_\)\+[l|L|n]\?\>"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
272 syn match ocamlNumber "-\=\<0[b|B]\([01]\|_\)\+[l|L|n]\?\>"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
273 syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 " Labels
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
276 syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
277 syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
278 syn region ocamlLabel transparent matchgroup=ocamlLabel start="[~?](\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 " Synchronization
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 syn sync minlines=50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 syn sync maxlines=500
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 syn sync match ocamlDoSync grouphere ocamlDo "\<do\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 syn sync match ocamlDoSync groupthere ocamlDo "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 if exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 syn sync match ocamlEndSync grouphere ocamlEnd "\<\(object\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 syn sync match ocamlEndSync grouphere ocamlEnd "\<\(begin\|object\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 syn sync match ocamlEndSync groupthere ocamlEnd "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 syn sync match ocamlStructSync grouphere ocamlStruct "\<struct\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 syn sync match ocamlStructSync groupthere ocamlStruct "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 syn sync match ocamlSigSync grouphere ocamlSig "\<sig\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 syn sync match ocamlSigSync groupthere ocamlSig "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
303
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
304 hi def link ocamlBraceErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
305 hi def link ocamlBrackErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
306 hi def link ocamlParenErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
307 hi def link ocamlArrErr Error
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
308
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
309 hi def link ocamlCommentErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
311 hi def link ocamlCountErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
312 hi def link ocamlDoErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
313 hi def link ocamlDoneErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
314 hi def link ocamlEndErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
315 hi def link ocamlThenErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
317 hi def link ocamlCharErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
319 hi def link ocamlErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
321 hi def link ocamlComment Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
323 hi def link ocamlModPath Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
324 hi def link ocamlObject Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
325 hi def link ocamlModule Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
326 hi def link ocamlModParam1 Include
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
327 hi def link ocamlGenMod Include
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
328 hi def link ocamlModType Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
329 hi def link ocamlMPRestr3 Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
330 hi def link ocamlFullMod Include
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
331 hi def link ocamlFuncWith Include
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
332 hi def link ocamlModParam Include
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
333 hi def link ocamlModTypeRestr Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
334 hi def link ocamlWith Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
335 hi def link ocamlMTDef Include
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
336 hi def link ocamlSigEncl ocamlModule
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
337 hi def link ocamlStructEncl ocamlModule
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
339 hi def link ocamlScript Include
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
341 hi def link ocamlConstructor Constant
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
343 hi def link ocamlVal Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
344 hi def link ocamlModPreRHS Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
345 hi def link ocamlMPRestr2 Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
346 hi def link ocamlKeyword Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
347 hi def link ocamlMethod Include
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
348 hi def link ocamlArrow Keyword
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
349 hi def link ocamlKeyChar Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
350 hi def link ocamlAnyVar Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
351 hi def link ocamlTopStop Keyword
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
352
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
353 hi def link ocamlRefAssign ocamlKeyChar
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
354 hi def link ocamlEqual ocamlKeyChar
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
355 hi def link ocamlStar ocamlInfixOp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
356 hi def link ocamlAngle ocamlInfixOp
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
357 hi def link ocamlCons ocamlInfixOp
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
358
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
359 hi def link ocamlPrefixOp ocamlOperator
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
360 hi def link ocamlInfixOp ocamlOperator
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
361 hi def link ocamlExtensionOp ocamlOperator
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
362 hi def link ocamlIndexingOp ocamlOperator
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
363
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
364 if exists("ocaml_highlight_operators")
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
365 hi def link ocamlInfixOpKeyword ocamlOperator
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
366 hi def link ocamlOperator Operator
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
367 else
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
368 hi def link ocamlInfixOpKeyword Keyword
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
369 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
371 hi def link ocamlBoolean Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
372 hi def link ocamlCharacter Character
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
373 hi def link ocamlNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
374 hi def link ocamlFloat Float
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
375 hi def link ocamlString String
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
376 hi def link ocamlQuotedStringDelim Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
378 hi def link ocamlLabel Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
379
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
380 hi def link ocamlType Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
382 hi def link ocamlTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
383
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
384 hi def link ocamlEncl Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
385
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
386 hi def link ocamlPpxEncl ocamlEncl
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 let b:current_syntax = "ocaml"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389
23466
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
390 let &cpo = s:keepcpo
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
391 unlet s:keepcpo
15fa3923cc49 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
392
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 " vim: ts=8