comparison runtime/syntax/ocaml.vim @ 5244:eb7ce2918a03

Updated runtime files.
author Bram Moolenaar <bram@vim.org>
date Sun, 28 Jul 2013 16:02:18 +0200
parents c869ff170ddc
children 43efa4f5a8ea
comparison
equal deleted inserted replaced
5243:1acc2a779325 5244:eb7ce2918a03
3 " Filenames: *.ml *.mli *.mll *.mly 3 " Filenames: *.ml *.mli *.mll *.mly
4 " Maintainers: Markus Mottl <markus.mottl@gmail.com> 4 " Maintainers: Markus Mottl <markus.mottl@gmail.com>
5 " Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de> 5 " Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de>
6 " Issac Trotts <ijtrotts@ucdavis.edu> 6 " Issac Trotts <ijtrotts@ucdavis.edu>
7 " URL: http://www.ocaml.info/vim/syntax/ocaml.vim 7 " URL: http://www.ocaml.info/vim/syntax/ocaml.vim
8 " Last Change: 2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen) 8 " Last Change: 2012 May 12 - Added Dominique Pellé's spell checking patch (MM)
9 " 2010 Sep 03 - Fixed escaping bug (MM, thanks to Florent Monnier) 9 " 2012 Feb 01 - Improved module path highlighting (MM)
10 " 2010 Aug 07 - Fixed module type bug (MM) 10 " 2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen)
11 11
12 " A minor patch was applied to the official version so that object/end 12 " A minor patch was applied to the official version so that object/end
13 " can be distinguished from begin/end, which is used for indentation, 13 " can be distinguished from begin/end, which is used for indentation,
14 " and folding. (David Baelde) 14 " and folding. (David Baelde)
15 15
26 26
27 " Access to the method of an object 27 " Access to the method of an object
28 syn match ocamlMethod "#" 28 syn match ocamlMethod "#"
29 29
30 " Script headers highlighted like comments 30 " Script headers highlighted like comments
31 syn match ocamlComment "^#!.*" 31 syn match ocamlComment "^#!.*" contains=@Spell
32 32
33 " Scripting directives 33 " Scripting directives
34 syn match ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\)\>" 34 syn match ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\)\>"
35 35
36 " lowercase identifier - the standard way to match 36 " lowercase identifier - the standard way to match
78 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr 78 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
79 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr 79 syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
80 80
81 81
82 " Comments 82 " Comments
83 syn region ocamlComment start="(\*" end="\*)" contains=ocamlComment,ocamlTodo 83 syn region ocamlComment start="(\*" end="\*)" contains=@Spell,ocamlComment,ocamlTodo
84 syn keyword ocamlTodo contained TODO FIXME XXX NOTE 84 syn keyword ocamlTodo contained TODO FIXME XXX NOTE
85 85
86 86
87 " Objects 87 " Objects
88 syn region ocamlEnd matchgroup=ocamlObject start="\<object\>" matchgroup=ocamlObject end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr 88 syn region ocamlEnd matchgroup=ocamlObject start="\<object\>" matchgroup=ocamlObject end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
112 " "sig" 112 " "sig"
113 syn region ocamlSig matchgroup=ocamlModule start="\<sig\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule 113 syn region ocamlSig matchgroup=ocamlModule start="\<sig\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
114 syn region ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr 114 syn region ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr
115 115
116 " "open" 116 " "open"
117 syn region ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment 117 syn region ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment
118 118
119 " "include" 119 " "include"
120 syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod 120 syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
121 121
122 " "module" - somewhat complicated stuff ;-) 122 " "module" - somewhat complicated stuff ;-)
128 syn region ocamlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlMPRestr,ocamlModTypeRestr 128 syn region ocamlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlMPRestr,ocamlModTypeRestr
129 129
130 syn region ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3 130 syn region ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3
131 syn region ocamlMPRestr1 matchgroup=ocamlModule start="\ssig\s\=" matchgroup=ocamlModule end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule 131 syn region ocamlMPRestr1 matchgroup=ocamlModule start="\ssig\s\=" matchgroup=ocamlModule end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
132 syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2 132 syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2
133 syn match ocamlMPRestr3 "\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*" contained 133 syn match ocamlMPRestr3 "\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*" contained
134 syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod 134 syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
135 syn keyword ocamlKeyword val 135 syn keyword ocamlKeyword val
136 syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr 136 syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment,ocamlFullMod skipwhite skipempty nextgroup=ocamlMPRestr
137 syn region ocamlModRHS start="." end=".\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod 137 syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
138 syn match ocamlFullMod "\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith 138 syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
139 139
140 syn region ocamlFuncWith start="([^*]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith 140 syn region ocamlFuncWith start="([^*]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
141 syn region ocamlFuncStruct matchgroup=ocamlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr 141 syn region ocamlFuncStruct matchgroup=ocamlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
142 142
143 syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*\>" contained 143 syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
144 syn region ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith 144 syn region ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith
145 syn match ocamlWith "\<\(\u\(\w\|'\)*\.\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest 145 syn match ocamlWith "\<\(\u\(\w\|'\)* *\. *\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest
146 syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained 146 syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained
147 147
148 " "struct" 148 " "struct"
149 syn region ocamlStruct matchgroup=ocamlModule start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr 149 syn region ocamlStruct matchgroup=ocamlModule start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
150 150
151 " "module type" 151 " "module type"
152 syn region ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef 152 syn region ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
153 syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s 153 syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod
154 154
155 syn keyword ocamlKeyword and as assert class 155 syn keyword ocamlKeyword and as assert class
156 syn keyword ocamlKeyword constraint else 156 syn keyword ocamlKeyword constraint else
157 syn keyword ocamlKeyword exception external fun 157 syn keyword ocamlKeyword exception external fun
158 158
186 186
187 " Polymorphic variants 187 " Polymorphic variants
188 syn match ocamlConstructor "`\w\(\w\|'\)*\>" 188 syn match ocamlConstructor "`\w\(\w\|'\)*\>"
189 189
190 " Module prefix 190 " Module prefix
191 syn match ocamlModPath "\u\(\w\|'\)*\."he=e-1 191 syn match ocamlModPath "\u\(\w\|'\)* *\."he=e-1
192 192
193 syn match ocamlCharacter "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'" 193 syn match ocamlCharacter "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'"
194 syn match ocamlCharacter "'\\x\x\x'" 194 syn match ocamlCharacter "'\\x\x\x'"
195 syn match ocamlCharErr "'\\\d\d'\|'\\\d'" 195 syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
196 syn match ocamlCharErr "'\\[^\'ntbr]'" 196 syn match ocamlCharErr "'\\[^\'ntbr]'"
197 syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ 197 syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
198 198
199 syn match ocamlFunDef "->" 199 syn match ocamlFunDef "->"
200 syn match ocamlRefAssign ":=" 200 syn match ocamlRefAssign ":="
201 syn match ocamlTopStop ";;" 201 syn match ocamlTopStop ";;"
202 syn match ocamlOperator "\^" 202 syn match ocamlOperator "\^"