source: documentation/trunk/packages/dokuwiki-2011-05-25a/inc/geshi/haskell.php@ 25027

Last change on this file since 25027 was 25027, checked in by jmt12, 12 years ago

Adding the packages directory, and within it a configured version of dokuwiki all ready to run

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