ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
haskell.php
Go to the documentation of this file.
1<?php
2/*************************************************************************************
3 * haskell.php
4 * ----------
5 * Author: Daniel Mlot (duplode_1 at yahoo dot com dot br)
6 * Based on haskell.php by Jason Dagit (dagit@codersbase.com), which was
7 * based on ocaml.php by Flaie (fireflaie@gmail.com).
8 * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
9 * Release Version: 1.0.8.12
10 * Date Started: 2014/05/12
11 *
12 * Haskell language file for GeSHi.
13 *
14 *************************************************************************************
15 *
16 * This file is part of GeSHi.
17 *
18 * GeSHi is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * GeSHi is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with GeSHi; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 *
32 ************************************************************************************/
33
35 'LANG_NAME' => 'Haskell',
36 'COMMENT_SINGLE' => array( 1 => '--'),
37 'COMMENT_MULTI' => array('{-' => '-}'),
38 'COMMENT_REGEXP' => array(
39 2 => "/-->/",
40 3 => "/{-(?:(?R)|.)-}/s", //Nested Comments
41 ),
42 'CASE_KEYWORDS' => 0,
43 'QUOTEMARKS' => array('"'),
44 'ESCAPE_CHAR' => '\\',
45 'KEYWORDS' => array(
46 /* main haskell keywords */
47 1 => array(
48 'as',
49 'case', 'of', 'class', 'data', 'default',
50 'deriving', 'do', 'forall', 'hiding', 'if', 'then',
51 'else', 'import', 'infix', 'infixl', 'infixr',
52 'instance', 'let', 'in', 'module', 'newtype',
53 'qualified', 'type', 'where'
54 ),
55 /* define names of main libraries, so we can link to it */
56 2 => array(
57 'Foreign', 'Numeric', 'Prelude'
58 ),
59 /* just link to Prelude functions, cause it's the default opened library when starting Haskell */
60 3 => array(
61 'not', 'otherwise', 'maybe',
62 'either', 'fst', 'snd', 'curry', 'uncurry',
63 'compare',
64 'max', 'min', 'succ', 'pred', 'toEnum', 'fromEnum',
65 'enumFrom', 'enumFromThen', 'enumFromTo',
66 'enumFromThenTo', 'minBound', 'maxBound',
67 'negate', 'abs', 'signum',
68 'fromInteger', 'toRational', 'quot', 'rem',
69 'div', 'mod', 'quotRem', 'divMod', 'toInteger',
70 'recip', 'fromRational', 'pi', 'exp',
71 'log', 'sqrt', 'logBase', 'sin', 'cos',
72 'tan', 'asin', 'acos', 'atan', 'sinh', 'cosh',
73 'tanh', 'asinh', 'acosh', 'atanh',
74 'properFraction', 'truncate', 'round', 'ceiling',
75 'floor', 'floatRadix', 'floatDigits', 'floatRange',
76 'decodeFloat', 'encodeFloat', 'exponent',
77 'significand', 'scaleFloat', 'isNaN', 'isInfinite',
78 'isDenomalized', 'isNegativeZero', 'isIEEE',
79 'atan2', 'subtract', 'even', 'odd', 'gcd',
80 'lcm', 'fromIntegral', 'realToFrac',
81 'return', 'fail', 'fmap',
82 'mapM', 'mapM_', 'sequence', 'sequence_',
83 'id', 'const','flip',
84 'until', 'asTypeOf', 'error', 'undefined',
85 'seq','map','filter', 'head',
86 'last', 'tail', 'init', 'null', 'length',
87 'reverse', 'foldl', 'foldl1', 'foldr',
88 'foldr1', 'and', 'or', 'any', 'all', 'sum',
89 'product', 'concat', 'concatMap', 'maximum',
90 'minimum', 'scanl', 'scanl1', 'scanr', 'scanr1',
91 'iterate', 'repeat', 'cycle', 'take', 'drop',
92 'splitAt', 'takeWhile', 'dropWhile', 'span',
93 'break', 'elem', 'notElem', 'lookup', 'zip',
94 'zip3', 'zipWith', 'zipWith3', 'unzip', 'unzip3',
95 'lines', 'words', 'unlines',
96 'unwords', 'showPrec', 'show', 'showList',
97 'shows', 'showChar', 'showString', 'showParen',
98 'readsPrec', 'readList', 'reads', 'readParen',
99 'read', 'lex', 'putChar', 'putStr', 'putStrLn',
100 'print', 'getChar', 'getLine', 'getContents',
101 'interact', 'readFile', 'writeFile', 'appendFile',
102 'readIO', 'readLn', 'ioError', 'userError', 'catch'
103 ),
104 /* Prelude types */
105 4 => array (
106 'Bool', 'Maybe', 'Either', 'Ordering',
107 'Char', 'String',
108 'Int', 'Integer', 'Float', 'Double', 'Rational',
109 'ShowS', 'ReadS',
110 'IO', 'IOError', 'IOException'
111 ),
112 /* Prelude classes */
113 5 => array (
114 'Ord', 'Eq', 'Enum', 'Bounded',
115 'Num', 'Real', 'Integral', 'Fractional',
116 'Floating', 'RealFrac', 'RealFloat',
117 'Monad', 'Functor',
118 'Show', 'Read'
119 )
120 ),
121 /* Most symbol combinations can be valid Haskell operators */
122 'SYMBOLS' => array(
123 '!', '@', '#', '$', '%', '&', '*', '-', '+', '=',
124 '^', '~', '|', '\\', '>', '<', ':', '?', '/'
125 ),
126 'CASE_SENSITIVE' => array(
127 GESHI_COMMENTS => false,
128 1 => true, /* Haskell is a case sensitive language */
129 2 => true,
130 3 => true,
131 4 => true,
132 5 => true
133 ),
134 'STYLES' => array(
135 'KEYWORDS' => array(
136 1 => 'color: #06c; font-weight: bold;', /* nice blue */
137 2 => 'color: #06c; font-weight: bold;', /* blue as well */
138 3 => 'font-weight: bold;', /* make the preduled functions bold */
139 4 => 'color: #cccc00; font-weight: bold;', /* give types a different bg */
140 5 => 'color: maroon; font-weight: bold;' /* similarly for classes */
141 ),
142 'COMMENTS' => array(
143 1 => 'color: #5d478b; font-style: italic;',
144 2 => 'color: #339933; font-weight: bold;',
145 3 => 'color: #5d478b; font-style: italic;', /* light purple */
146 'MULTI' => 'color: #5d478b; font-style: italic;' /* light purple */
147 ),
148 'ESCAPE_CHAR' => array(
149 0 => 'background-color: #3cb371; font-weight: bold;'
150 ),
151 'BRACKETS' => array(
152 0 => 'color: green;'
153 ),
154 'STRINGS' => array(
155 0 => 'color: #3cb371;' /* nice green */
156 ),
157 'NUMBERS' => array(
158 0 => 'color: red;' /* pink */
159 ),
160 'METHODS' => array(
161 1 => 'color: #060;' /* dark green */
162 ),
163 'REGEXPS' => array(
164 ),
165 'SYMBOLS' => array(
166 0 => 'color: #339933; font-weight: bold;'
167 ),
168 'SCRIPT' => array(
169 )
170 ),
171 'URLS' => array(
172 /* some of keywords are Prelude functions */
173 1 => '',
174 /* link to the wanted library */
175 2 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/{FNAME}.html',
176 /* link to Prelude functions */
177 3 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:{FNAME}',
178 /* link to Prelude types */
179 4 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}',
180 /* link to Prelude exceptions */
181 5 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}'
182 ),
183 'OOLANG' => false,
184 'OBJECT_SPLITTERS' => array(
185 ),
186 'REGEXPS' => array(
187 ),
188 'STRICT_MODE_APPLIES' => GESHI_NEVER,
189 'SCRIPT_DELIMITERS' => array(
190 ),
191 'HIGHLIGHT_STRICT_BLOCK' => array(
192 )
193);
An exception for terminatinating execution or to throw for unit testing.
const GESHI_COMMENTS
Used in language files to mark comments.
Definition: geshi.php:150
const GESHI_NEVER
#+ @access private
Definition: geshi.php:124
$language_data
Definition: haskell.php:34