2019-12-18 17:13:13 +01:00
|
|
|
## Syntax highlighting for OCaml.
|
|
|
|
|
2016-03-02 20:49:58 +01:00
|
|
|
syntax "OCaml" "\.mli?$"
|
2019-12-18 17:20:31 +01:00
|
|
|
magic "OCaml"
|
2019-12-18 17:13:13 +01:00
|
|
|
comment "(*|*)"
|
|
|
|
|
2015-12-15 03:18:32 +01:00
|
|
|
#uid
|
|
|
|
color red "\<[A-Z][0-9a-z_]{2,}\>"
|
|
|
|
#declarations
|
|
|
|
color green "\<(let|val|method|in|and|rec|private|virtual|constraint)\>"
|
|
|
|
#structure items
|
|
|
|
color red "\<(type|open|class|module|exception|external)\>"
|
|
|
|
#patterns
|
|
|
|
color blue "\<(fun|function|functor|match|try|with)\>"
|
|
|
|
#patterns-modifiers
|
|
|
|
color yellow "\<(as|when|of)\>"
|
|
|
|
#conditions
|
|
|
|
color cyan "\<(if|then|else)\>"
|
|
|
|
#blocs
|
|
|
|
color magenta "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>"
|
|
|
|
#constantes
|
|
|
|
color green "\<(true|false)\>"
|
|
|
|
#modules/classes
|
|
|
|
color green "\<(include|inherit|initializer)\>"
|
|
|
|
#expr modifiers
|
|
|
|
color yellow "\<(new|ref|mutable|lazy|assert|raise)\>"
|
|
|
|
#comments
|
|
|
|
color white start="\(\*" end="\*\)"
|
|
|
|
#strings (no multiline handling yet)
|
|
|
|
color brightblack ""[^\"]*""
|
2016-12-06 22:07:25 +01:00
|
|
|
## Trailing spaces
|
|
|
|
color ,green "[[:space:]]+$"
|