3 * Description: Haskell programming language.
5 * Simple highlighting treating keywords, comments, strings and type
6 * expressions specially.
8 * Author: Hans-Wolfgang Loidl <hwloidl@dcs.gla.ac.uk>
12 state haskell extends HighlightEntry
18 call (haskell_comment);
22 /* One line comments. */
30 /* Built-in beasts (GHC specific). */
34 call (haskell_builtin);
38 /* Type declarations. */
43 /* call (haskell_type); */
47 /* String constants. */
51 call (haskell_string);
55 /* Pre-processor lines. */
57 reference_face (true);
60 /* call (haskell_ppline); */
61 reference_face (false);
64 /* Character constants. */
72 I took that from haskell.el. The True Way to do it would be to grab it
73 out of the on-line haskell report (actually, The Real True Way would
74 be to write a Haskell program that extracts different kinds of
75 keywords and to partially evaluate it wrt the Haskell report; but that
76 might be a wee overkill).
78 '("case" "class" "data" "default" "deriving" "else" "hiding" "if" "import" "in" "\
79 infix" "infixl" "infixr" "instance" "interface" "let" "module" "of" "renaming" "\
80 then" "to" "type" "where" )))
84 \(infix\|then\)\|c\(ase\|lass\)\|d\(ata\|e\(fault\|riving\)\)\|else\|hiding\|i\([fn]\|mport\|n\(fix[lr]\|stance\|terface\)\)\|let\|module\|of\|renaming\|t\(o\|ype\)\|where
86 /\b((infix|then)|c(ase|lass)|d(ata|e(fault|riving))|else|hiding|i([fn]|mport|n(fix[lr]|stance|terface))|let|module|of|renaming|t(o|ype)|where)\b/ {
93 state haskell_comment extends Highlight
101 /* HWL: for GHC builtin objects like _parGlobal_ i.e. not std Haskell */
102 state haskell_builtin extends Highlight
110 state haskell_type extends Highlight
112 /* ToDo: Implement type continuation lines:
113 If the line ends in a -> or the next starts with a -> then we
114 are still in a type expression
122 state haskell_string extends Highlight
133 state haskell_ppline extends Highlight
136 /* Comment within a pre-processor line. */
137 reference_face (false);
141 comment_face (false);
142 reference_face (true);