Skip to content

Commit 47604e0

Browse files
Maelancopy
authored andcommitted
ocaml syntax: rename some matchgroups relating to modules
(those I could make sense of)
1 parent 3a2c156 commit 47604e0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

syntax/ocaml.vim

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ syn match ocamlKwErr "\<\(mutable\|nonrec\|of\|private\)\>"
7777
syn cluster ocamlAllErrs contains=@ocamlAENoParen,ocamlParenErr
7878
syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr,ocamlKwErr
7979

80-
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlModRHS,ocamlFuncWith,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
80+
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlModTypePre,ocamlModRHS,ocamlFuncWith,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlFullMod,ocamlVal
8181

8282

8383
" Enclosing delimiters
@@ -129,16 +129,17 @@ syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModPa
129129

130130
" "module" - somewhat complicated stuff ;-)
131131
syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
132-
syn region ocamlPreDef start="."me=e-1 end="[a-z:=)]\@=" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr nextgroup=ocamlMPRestr,ocamlModPreRHS
132+
syn region ocamlPreDef start="."me=e-1 end="[a-z:=)]\@=" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr nextgroup=ocamlModTypePre,ocamlModPreRHS
133133
syn region ocamlModParam start="(\*\@!" end=")" contained contains=ocamlGenMod,ocamlModParam,ocamlModParam1,ocamlSig,ocamlVal
134134
syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty
135135
syn match ocamlGenMod "()" contained skipwhite skipempty
136136

137-
syn match ocamlMPRestr ":" contained skipwhite skipempty nextgroup=ocamlModTRWith,ocamlSig,ocamlMPRestr2,ocamlModTypeRestr,ocamlModTypeOf
137+
syn match ocamlModTypePre ":" contained skipwhite skipempty nextgroup=ocamlModTRWith,ocamlSig,ocamlFunctor,ocamlModTypeRestr,ocamlModTypeOf
138138
syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
139+
139140
syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
140141
syn keyword ocamlKeyword val
141-
syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment,ocamlFullMod skipwhite skipempty nextgroup=ocamlMPRestr
142+
syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment,ocamlFullMod skipwhite skipempty nextgroup=ocamlModTypePre
142143
syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
143144
syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
144145

@@ -155,7 +156,7 @@ syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=str
155156
syn region ocamlSig matchgroup=ocamlSigEncl start="\<sig\>" matchgroup=ocamlSigEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
156157

157158
" "functor"
158-
syn region ocamlMPRestr2 start="\<functor\>" matchgroup=ocamlKeyword end="->" contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod skipwhite skipempty nextgroup=ocamlStruct,ocamlSig,ocamlFuncWith,ocamlMPRestr2
159+
syn region ocamlFunctor start="\<functor\>" matchgroup=ocamlKeyword end="->" contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod skipwhite skipempty nextgroup=ocamlStruct,ocamlSig,ocamlFuncWith,ocamlFunctor
159160

160161
" "module type"
161162
syn region ocamlModTypeOf start="\<module\s\+type\(\s\+of\)\=\>" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
@@ -582,7 +583,6 @@ hi def link ocamlObject Include
582583
hi def link ocamlModule Include
583584
hi def link ocamlModParam1 Include
584585
hi def link ocamlGenMod Include
585-
hi def link ocamlModType Include
586586
hi def link ocamlFullMod Include
587587
hi def link ocamlFuncWith Include
588588
hi def link ocamlModParam Include
@@ -599,7 +599,7 @@ hi def link ocamlEmptyConstructor ocamlConstructor
599599

600600
hi def link ocamlVal Keyword
601601
hi def link ocamlModPreRHS Keyword
602-
hi def link ocamlMPRestr2 Keyword
602+
hi def link ocamlFunctor Keyword
603603
hi def link ocamlModTypeOf Keyword
604604
hi def link ocamlKeyword Keyword
605605
hi def link ocamlMethod Include

0 commit comments

Comments
 (0)