1997-02-23 08:23:00 -08:00
|
|
|
; Highlighting patterns for hilit19 under caml-mode
|
|
|
|
|
|
|
|
; defined also in caml.el
|
|
|
|
(defvar caml-quote-char "'"
|
|
|
|
"*Quote for character constants. \"'\" for Objective Caml, \"`\" for Caml-Light.")
|
|
|
|
|
|
|
|
(defconst caml-mode-patterns
|
|
|
|
(list
|
|
|
|
;comments
|
|
|
|
'("\\(^\\|[^\"]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)"
|
|
|
|
2 comment)
|
|
|
|
;string
|
|
|
|
(list 'hilit-string-find (string-to-char caml-quote-char) 'string)
|
|
|
|
(list (concat caml-quote-char "\\(\\\\\\([ntbr" caml-quote-char "\\]\\|"
|
2000-04-05 11:30:22 -07:00
|
|
|
"[0-9][0-9][0-9]\\)\\|.\\)" caml-quote-char)
|
|
|
|
nil
|
|
|
|
'string)
|
1997-02-23 08:23:00 -08:00
|
|
|
;labels
|
2001-09-06 01:52:32 -07:00
|
|
|
'("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]" 1 brown)
|
|
|
|
'("[~?][ (]*[a-z][a-zA-Z0-9_']*" nil brown)
|
1997-02-23 08:23:00 -08:00
|
|
|
;modules
|
1998-10-14 00:36:51 -07:00
|
|
|
'("\\<\\(assert\\|open\\|include\\)\\>" nil brown)
|
2000-04-20 03:06:19 -07:00
|
|
|
'("`?\\<[A-Z][A-Za-z0-9_\']*\\>" nil MidnightBlue)
|
1997-02-23 08:23:00 -08:00
|
|
|
;definition
|
|
|
|
(list (concat
|
2000-04-05 11:30:22 -07:00
|
|
|
"\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
|
|
|
|
"\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
|
|
|
|
"\\|in\\(herit\\)?\\|let\\|m\\(ethod\\|utable\\|odule\\)"
|
|
|
|
"\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
|
|
|
|
"\\|v\\(al\\(ue\\)?\\|irtual\\)\\)\\>")
|
|
|
|
nil 'ForestGreen)
|
1997-02-23 08:23:00 -08:00
|
|
|
;blocking
|
2000-05-07 19:45:05 -07:00
|
|
|
'("\\<\\(object\\|struct\\|sig\\|begin\\|end\\)\\>" 2 include)
|
1997-02-23 08:23:00 -08:00
|
|
|
;control
|
|
|
|
(list (concat
|
2000-04-05 11:30:22 -07:00
|
|
|
"\\<\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|if"
|
|
|
|
"\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)"
|
|
|
|
"\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\>"
|
|
|
|
"\\|\|\\|->\\|&\\|#")
|
|
|
|
nil 'keyword)
|
1997-02-23 08:23:00 -08:00
|
|
|
'(";" nil struct))
|
|
|
|
"Hilit19 patterns used for Caml mode")
|
|
|
|
|
|
|
|
(hilit-set-mode-patterns 'caml-mode caml-mode-patterns)
|
|
|
|
(hilit-set-mode-patterns
|
|
|
|
'inferior-caml-mode
|
|
|
|
(append
|
|
|
|
(list
|
|
|
|
;inferior
|
2000-04-20 03:06:19 -07:00
|
|
|
'("^[#-]" nil firebrick))
|
1997-02-23 08:23:00 -08:00
|
|
|
caml-mode-patterns))
|
|
|
|
|
|
|
|
(provide 'caml-hilit)
|