text/x-ocaml
*.ml;*.mli;*.mll;*.mly
(*
*)
\b[A-Z][A-Za-z0-9_']*
\b[a-z][A-Za-z0-9_']*
\\((\\|"|'|n|t|b|r)|[0-9]{3}|x[0-9a-fA-F]{2})
\%{char-esc}
\(\*\*
\*\)
[-]?[0-9][0-9_]*[lLn]?
[-]?0[xX][0-9A-Fa-f][0-9A-Fa-f_]*[lL]?
[-]?0[oO][0-7][0-7_]*[lL]?
[-]?0[bB][01][01_]*[lL]?
[-]?[0-9][0-9_]*(\.[0-9_]*)?([Ee][+-]?[0-9][0-9_]*)?
[~?]\%{low-ident}
`\%{cap-ident}
\%{cap-ident}(\.\%{cap-ident})*(?=\.)
\%{cap-ident}
"
"
('\%{char-esc}')|('[^\\']')
'\%{low-ident}
\[\|
\|\]
\|\]
\[
(?<!\|)\]
\]
true
false
asr
do
else
for
if
while
as
assert
begin
do
done
downto
else
end
for
if
land
lazy
lor
lsl
lsr
lxor
match
mod
new
object
or
sig
struct
then
to
try
when
while
with
#
and
class
constraint
exception
external
let
fun
function
functor
in
include
inherit
initializer
method
module
mutable
of
open
private
rec
type
val
virtual
option
ignore
ref
array
bool
char
float
int
list
string
unit
\%{low-ident}