Skip to content

Commit 5f19dee

Browse files
committed
Syntax: Dedicated group for type decl identifiers
1 parent 1e61347 commit 5f19dee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

syntax/ocaml.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ setlocal iskeyword+=`
3737
" OCaml is case sensitive.
3838
syn case match
3939

40+
syn match ocamlWhite /[ \t\n\r]*/
41+
4042
" Access to the method of an object
4143
syn match ocamlMethod "#"
4244

@@ -481,8 +483,8 @@ hi link ocamlTypeDefImpl ocamlTypeCatchAll
481483
" ocamlTypeDefImpl.
482484
syn region ocamlTypeDef
483485
\ matchgroup=ocamlKeyword start="\<type\>\(\_s\+\<nonrec\>\)\?\|\<constraint\>"
484-
\ matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>"
485-
\ contains=@ocamlAllErrs,ocamlComment,ocamlTypeVariance,ocamlTypeVar
486+
\ matchgroup=ocamlTypeIdentifier end="\<\l\(\w\|'\)*\>"
487+
\ contains=@ocamlAllErrs,ocamlComment,ocamlTypeVariance,ocamlTypeVar,ocamlWhite
486488
\ skipwhite skipempty
487489
\ nextgroup=ocamlTypeDefImpl,ocamlTypeDefAnd
488490

@@ -492,8 +494,8 @@ syn region ocamlTypeDef
492494
" ocamlTypeDefImpl.
493495
syn region ocamlTypeDefAnd
494496
\ matchgroup=ocamlKeyword start="\<and\>"
495-
\ matchgroup=ocamlLCIdentifier end="\<\l\(\w\|'\)*\>"
496-
\ contains=@ocamlAllErrs,ocamlComment,ocamlTypeVariance,ocamlTypeVar
497+
\ matchgroup=ocamlTypeIdentifier end="\<\l\(\w\|'\)*\>"
498+
\ contains=@ocamlAllErrs,ocamlComment,ocamlTypeVariance,ocamlTypeVar,ocamlWhite
497499
\ skipwhite skipempty
498500
\ nextgroup=ocamlTypeDefImpl,ocamlTypeDefAnd
499501

@@ -505,6 +507,7 @@ syn region ocamlExceptionDef
505507
\ skipwhite skipempty
506508
\ nextgroup=ocamlTypeDefImpl
507509

510+
hi link ocamlTypeIdentifier ocamlLCIdentifier
508511
syn cluster ocamlTypeContained add=ocamlTypePrivate
509512
syn keyword ocamlTypePrivate contained private
510513
hi link ocamlTypePrivate ocamlKeyword

0 commit comments

Comments
 (0)