This commit is contained in:
Adam Stankiewicz
2019-11-12 21:56:06 +01:00
parent 4e95df7c7e
commit 0c79dd3e73
18 changed files with 770 additions and 292 deletions

View File

@@ -230,7 +230,18 @@ syn match ocamlStar "*"
syn match ocamlAngle "<"
syn match ocamlAngle ">"
" Custom indexing operators:
syn match ocamlIndexingOp "\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\(()\|\[]\|{}\)\(<-\)\?"
syn region ocamlIndexing matchgroup=ocamlIndexingOp
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*("
\ end=")\(\_s*<-\)\?"
\ contains=ALLBUT,@ocamlContained,ocamlParenErr
syn region ocamlIndexing matchgroup=ocamlIndexingOp
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*\["
\ end="]\(\_s*<-\)\?"
\ contains=ALLBUT,@ocamlContained,ocamlBrackErr
syn region ocamlIndexing matchgroup=ocamlIndexingOp
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*{"
\ end="}\(\_s*<-\)\?"
\ contains=ALLBUT,@ocamlContained,ocamlBraceErr
" Extension operators (has to be declared before regular infix operators):
syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
" Infix and prefix operators: