-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcaml.nanorc
51 lines (40 loc) · 1.59 KB
/
caml.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## Caml, ML, F, and OCaml syntax coloration, for Nano
## (C) 05/2012 Lilian Besson (lilian DOT besson AT normale DOT fr)
## Last version : http://besson.qc.to/NanoSyntax/caml.nanorc
syntax "ocaml" "\.mli?$" "rlwrap"
##possible errors : open "[( that are not closed yet
# color brightwhite "(\(|\"|\[)(\\.|[^(\)|\"|\])*$"
# color white "\([^*](.*|[^)])*\)"
# color green "\[(.*|[^]])*\]"
#uid
color red "\<[A-Z][0-9a-z_]{2,}\>"
#command
color brightred,black start="^#" end=";;"
##keywords
color brightblue "\<(let|val|method|in|and|rec|private|virtual|constraint)\>"
color green,black "\<(if|then|else)\>"
color blue "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>"
color yellow "\<(as|when|of)\>"
color red "\<(int|float|bool|char|string)\>"
color brightblue "\<(new|ref|mutable|lazy|assert|raise|)\>"
color brightgreen "\|"
color brightblue "\<(include|inherit|initializer)\>"
color blue "\<(fun|function|functor|match|try|with)\>"
color brightblue "\;(\;)?"
color brightred "\<(type|open|class|module|exception|external)\>"
##numbers and strings
color yellow "[[:space:]][0-9][0-9]*(\.)?"
color green "\[\]"
color brightgreen "\<(true|false)\>"
color magenta "<[^= ]*>" ""(\\.|[^\"])*""
color magenta start=""(\\.|[^\"])*\\ *$" end="^(\\.|[^\"])*""
##relations and operators
color brightyellow "(\=|[ ]*>[ ]*|[ ]*<[ ]*|\:\=)"
color brightgreen "\:\:"
color brightyellow "(\+|\*|\/|-)(\.)?"
color brightgreen "\->"
##Comments
# color brightcyan "\(\*(\\.|\*|\(|[^\*]\)|[^(\*\))])*$"
# color cyan "\(\*.*\*\)"
color black,white start="\(\*" end="\*\)"
color white,green start="\(\*\*" end="\*\)"