forked from n8gray/QLColorCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathml.lang
More file actions
54 lines (41 loc) · 1.65 KB
/
ml.lang
File metadata and controls
54 lines (41 loc) · 1.65 KB
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
52
53
54
# Objective Caml language definition file
#
# Author: Andre Simon
# Mail: andre.simon1@gmx.de
# Date: 17.11.2003
# ------------------------------------------
# This file is a part of highlight, a free source code converter released under the GPL.
#
# The file is used to describe keywords and special symbols of programming languages.
# See README in the highlight directory for details.
#
# New definition files for future releases of highlight are always appreciated ;)
#
# ----------
# andre.simon1@gmx.de
# http:/www.andre-simon.de/
# Modified by Nathan Gray
# Character literals
$KEYWORDS(str)=regex('(?:[^\\]|\\.|\\[a-fA-F0-9]{2,3})')
$KEYWORDS(kwa)=and as assert asr begin class constraint do done downto else
end exception external false for functor if in include inherit
initializer land lazy let lor lsl lsr lxor match method mod module mutable new
object of open or private rec sig struct then to true try type val virtual when
while with
# Types and type variables
$KEYWORDS(kwb)=int float string char bool list exn array option format fpclass in_channel out_channel open_flag ref unit
$KEYWORDS(kwb)=regex((?<=type )(?:'[a-z]\w*[ \t]+)*[a-z]\w*|'[a-zA-Z_]+|\b[A-Z][a-zA-Z0-9_']*)
#$KEYWORDS(kwb)=regex((?<=type) +(?:'[a-z]\w*[ \t]+)*[a-z][\w']*)
# Modules
$KEYWORDS(callr)=regex(\b[A-Z][a-zA-Z0-9_']*(?=\.))
# Function defs
$KEYWORDS(fndef)=fun function
$KEYWORDS(fndef)=regex(let([ \t]+rec)?[ \t]+([a-z][\w']*)[ \t]+[^=:,])
$STRINGDELIMITERS="
$ML_COMMENT=(* *)
$ALLOWNESTEDCOMMENTS=true
$IGNORECASE=false
$ESCCHAR=\
$SYMBOLS= ( ) [ ] { } , ; : & | < > ! = / * % + -
# This breaks keywords (kwa) for some reason:
# $IDENTIFIER=regex(\b[a-z_][a-zA-Z0-9_']*?)