annotate runtime/syntax/ocaml.vim @ 18486:9d887cad7315

Added tag v8.1.2237 for changeset 63ee3c2b140fe1b4801389872a8e47aec19d028b
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Oct 2019 20:00:04 +0100
parents 432714f5c0f7
children 15fa3923cc49
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>
17261
432714f5c0f7 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 16971
diff changeset
7 " URL: https://github.com/rgrinberg/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
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
21 " quit when a syntax file was already loaded
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
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
26 " ' can be used in OCaml identifiers
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
27 setlocal iskeyword+='
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
28
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " OCaml is case sensitive.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
32 " Access to the method of an object
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
33 syn match ocamlMethod "#"
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
34
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " Script headers highlighted like comments
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
36 syn match ocamlComment "^#!.*" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Scripting directives
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
39 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
40
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " lowercase identifier - the standard way to match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match ocamlKeyChar "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match ocamlBraceErr "}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match ocamlBrackErr "\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match ocamlParenErr ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match ocamlArrErr "|]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match ocamlCommentErr "\*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match ocamlCountErr "\<downto\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match ocamlCountErr "\<to\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match ocamlDoErr "\<do\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match ocamlDoneErr "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match ocamlThenErr "\<then\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Error-highlighting of "end" without synchronization:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " as keyword or as error (default)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 if exists("ocaml_noend_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match ocamlKeyword "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match ocamlEndErr "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " Some convenient clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
77 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
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Enclosing delimiters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " Comments
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
88 syn region ocamlComment start="(\*" end="\*)" contains=@Spell,ocamlComment,ocamlTodo
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
89 syn keyword ocamlTodo contained TODO FIXME XXX NOTE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 " Objects
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
93 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
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 " Blocks
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 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
99 endif
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 " "for"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 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
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " "do"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 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
109 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " "if"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 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
113
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
114 "" PPX nodes
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
115
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
116 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
117 syn region ocamlPpx matchgroup=ocamlPpxEncl start="\[@\{1,3\}" contains=TOP end="\]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 "" Modules
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 " "sig"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
122 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
123 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
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " "open"
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
126 syn region ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 " "include"
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
129 syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 " "module" - somewhat complicated stuff ;-)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 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
133 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
134 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
135 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
136 syn match ocamlGenMod "()" contained skipwhite skipempty
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 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
139 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
140 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
141 syn match ocamlMPRestr3 "\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
143 syn keyword ocamlKeyword val
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
144 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
145 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
146 syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
148 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
149 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
150
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
151 syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 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
153 syn match ocamlWith "\<\(\u\(\w\|'\)* *\. *\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
156 " "struct"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
157 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
158
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " "module type"
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
160 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
161 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
162
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
163 " Quoted strings
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
164 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
165
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 syn keyword ocamlKeyword and as assert class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn keyword ocamlKeyword constraint else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 syn keyword ocamlKeyword exception external fun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 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
171 syn keyword ocamlKeyword lazy let match
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
172 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
173 syn keyword ocamlKeyword parser private rec
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 syn keyword ocamlKeyword try type
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
175 syn keyword ocamlKeyword virtual when while with
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 if exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 syn keyword ocamlKeyword do value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 syn keyword ocamlBoolean True False
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 syn keyword ocamlKeyword function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 syn keyword ocamlBoolean true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
185 syn keyword ocamlType array bool char exn float format format4
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
186 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
187 syn keyword ocamlType bytes string unit
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 syn match ocamlConstructor "(\s*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 syn match ocamlConstructor "\[\s*\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 syn match ocamlConstructor "\[|\s*>|]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 syn match ocamlConstructor "\[<\s*>\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 syn match ocamlConstructor "\u\(\w\|'\)*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 " Polymorphic variants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn match ocamlConstructor "`\w\(\w\|'\)*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 " Module prefix
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
199 syn match ocamlModPath "\u\(\w\|'\)* *\."he=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 syn match ocamlCharacter "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'"
2833
c869ff170ddc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
202 syn match ocamlCharacter "'\\x\x\x'"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 syn match ocamlCharErr "'\\[^\'ntbr]'"
5244
eb7ce2918a03 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2833
diff changeset
205 syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
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 ocamlTopStop ";;"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn match ocamlAnyVar "\<_\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn match ocamlKeyChar "|[^\]]"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn match ocamlKeyChar ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 syn match ocamlKeyChar "\~"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 syn match ocamlKeyChar "?"
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
214
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
215 "" Operators
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
217 " 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
218 " 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
219 " 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
220 " 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
221 " =, *, < 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
222 " 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
223 syn match ocamlEqual "="
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
224 syn match ocamlStar "*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
225 syn match ocamlAngle "<"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
226 syn match ocamlAngle ">"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
227 " Custom indexing operators:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
228 syn match ocamlIndexingOp "\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\(()\|\[]\|{}\)\(<-\)\?"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
229 " 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
230 syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
231 " Infix and prefix operators:
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
232 syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
233 syn match ocamlPrefixOp "[~?][~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
234 syn match ocamlInfixOp "[&$%@^/+-][~?!.:|&$%<=>@^*/+-]*"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
235 syn match ocamlInfixOp "[|<=>*][~?!.:|&$%<=>@^*/+-]\+"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
236 syn match ocamlInfixOp "#[~?!.:|&$%<=>@^*/+-]\+#\@!"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
237 syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
238 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
239 " := 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
240 " (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
241 syn match ocamlRefAssign ":="
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
242 " :: 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
243 syn match ocamlCons "::"
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
244 " -> 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
245 syn match ocamlArrow "->[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 if exists("ocaml_revised")
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
247 syn match ocamlErr "<-[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 else
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
249 syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
252 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
253 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
254 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
255 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
256 syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 " Labels
550
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
259 syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
74c2ea3c3081 updated for version 7.0156
vimboss
parents: 20
diff changeset
260 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
261 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
262
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 " Synchronization
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 syn sync minlines=50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 syn sync maxlines=500
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 if !exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 syn sync match ocamlDoSync grouphere ocamlDo "\<do\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 syn sync match ocamlDoSync groupthere ocamlDo "\<done\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 if exists("ocaml_revised")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 syn sync match ocamlEndSync grouphere ocamlEnd "\<\(object\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 syn sync match ocamlEndSync grouphere ocamlEnd "\<\(begin\|object\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 syn sync match ocamlEndSync groupthere ocamlEnd "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 syn sync match ocamlStructSync grouphere ocamlStruct "\<struct\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 syn sync match ocamlStructSync groupthere ocamlStruct "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 syn sync match ocamlSigSync grouphere ocamlSig "\<sig\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 syn sync match ocamlSigSync groupthere ocamlSig "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
286 " Only when an item doesn't have highlighting yet
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
287
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
288 hi def link ocamlBraceErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
289 hi def link ocamlBrackErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
290 hi def link ocamlParenErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
291 hi def link ocamlArrErr Error
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 5244
diff changeset
292
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
293 hi def link ocamlCommentErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
295 hi def link ocamlCountErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
296 hi def link ocamlDoErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
297 hi def link ocamlDoneErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
298 hi def link ocamlEndErr Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
299 hi def link ocamlThenErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
301 hi def link ocamlCharErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
303 hi def link ocamlErr Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
305 hi def link ocamlComment Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
307 hi def link ocamlModPath Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
308 hi def link ocamlObject Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
309 hi def link ocamlModule Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
310 hi def link ocamlModParam1 Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
311 hi def link ocamlModType Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
312 hi def link ocamlMPRestr3 Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
313 hi def link ocamlFullMod Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
314 hi def link ocamlModTypeRestr Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
315 hi def link ocamlWith Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
316 hi def link ocamlMTDef Include
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
317 hi def link ocamlSigEncl ocamlModule
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
318 hi def link ocamlStructEncl ocamlModule
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
320 hi def link ocamlScript Include
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
322 hi def link ocamlConstructor Constant
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
324 hi def link ocamlVal Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
325 hi def link ocamlModPreRHS Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
326 hi def link ocamlMPRestr2 Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
327 hi def link ocamlKeyword Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
328 hi def link ocamlMethod Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
329 hi def link ocamlKeyChar Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
330 hi def link ocamlAnyVar Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
331 hi def link ocamlTopStop Keyword
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
332
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
333 hi def link ocamlRefAssign ocamlKeyChar
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
334 hi def link ocamlEqual ocamlKeyChar
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
335 hi def link ocamlStar ocamlInfixOp
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
336 hi def link ocamlAngle ocamlInfixOp
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
337 hi def link ocamlCons ocamlInfixOp
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
338
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
339 hi def link ocamlPrefixOp ocamlOperator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
340 hi def link ocamlInfixOp ocamlOperator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
341 hi def link ocamlExtensionOp ocamlOperator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
342 hi def link ocamlIndexingOp ocamlOperator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
343
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
344 if exists("ocaml_highlight_operators")
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
345 hi def link ocamlInfixOpKeyword ocamlOperator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
346 hi def link ocamlOperator Operator
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
347 else
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
348 hi def link ocamlInfixOpKeyword Keyword
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
349 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
351 hi def link ocamlBoolean Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
352 hi def link ocamlCharacter Character
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
353 hi def link ocamlNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
354 hi def link ocamlFloat Float
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
355 hi def link ocamlString String
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
356 hi def link ocamlQuotedStringDelim Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
358 hi def link ocamlLabel Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
359
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
360 hi def link ocamlType Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
362 hi def link ocamlTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
363
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
364 hi def link ocamlEncl Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
365
16971
e18b1c654d09 Update runtime files - Add typescript syntax and indent.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
366 hi def link ocamlPpxEncl ocamlEncl
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 let b:current_syntax = "ocaml"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 " vim: ts=8