1 <?php 2 /************************************************************************************* 3 * haskell.php 4 * ---------- 5 * Author: Jason Dagit (dagit (at) codersbase.com) based on ocaml.php by Flaie (fireflaie (at) gmail.com) 6 * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter) 7 * Release Version: 1.0.8.3 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(2 => "/-->/"), 45 'CASE_KEYWORDS' => 0, 46 'QUOTEMARKS' => array('"'), 47 'ESCAPE_CHAR' => "\\", 48 'KEYWORDS' => array( 49 /* main haskell keywords */ 50 1 => array( 51 'as', 52 'case', 'of', 'class', 'data', 'default', 53 'deriving', 'do', 'forall', 'hiding', 'if', 'then', 54 'else', 'import', 'infix', 'infixl', 'infixr', 55 'instance', 'let', 'in', 'module', 'newtype', 56 'qualified', 'type', 'where' 57 ), 58 /* define names of main librarys, so we can link to it */ 59 2 => array( 60 'Foreign', 'Numeric', 'Prelude' 61 ), 62 /* just link to Prelude functions, cause it's the default opened library when starting Haskell */ 63 3 => array( 64 'not', 'otherwise', 'maybe', 65 'either', 'fst', 'snd', 'curry', 'uncurry', 66 'compare', 67 'max', 'min', 'succ', 'pred', 'toEnum', 'fromEnum', 68 'enumFrom', 'enumFromThen', 'enumFromTo', 69 'enumFromThenTo', 'minBound', 'maxBound', 70 'negate', 'abs', 'signum', 71 'fromInteger', 'toRational', 'quot', 'rem', 72 'div', 'mod', 'quotRem', 'divMod', 'toInteger', 73 'recip', 'fromRational', 'pi', 'exp', 74 'log', 'sqrt', 'logBase', 'sin', 'cos', 75 'tan', 'asin', 'acos', 'atan', 'sinh', 'cosh', 76 'tanh', 'asinh', 'acosh', 'atanh', 77 'properFraction', 'truncate', 'round', 'ceiling', 78 'floor', 'floatRadix', 'floatDigits', 'floatRange', 79 'decodeFloat', 'encodeFloat', 'exponent', 80 'significand', 'scaleFloat', 'isNaN', 'isInfinite', 81 'isDenomalized', 'isNegativeZero', 'isIEEE', 82 'atan2', 'subtract', 'even', 'odd', 'gcd', 83 'lcm', 'fromIntegral', 'realToFrac', 84 'return', 'fail', 'fmap', 85 'mapM', 'mapM_', 'sequence', 'sequence_', 86 'id', 'const','flip', 87 'until', 'asTypeOf', 'error', 'undefined', 88 'seq','map','filter', 'head', 89 'last', 'tail', 'init', 'null', 'length', 90 'reverse', 'foldl', 'foldl1', 'foldr', 91 'foldr1', 'and', 'or', 'any', 'all', 'sum', 92 'product', 'concat', 'concatMap', 'maximum', 93 'minimum', 'scanl', 'scanl1', 'scanr', 'scanr1', 94 'iterate', 'repeat', 'cycle', 'take', 'drop', 95 'splitAt', 'teakWhile', 'dropWhile', 'span', 96 'break', 'elem', 'notElem', 'lookup', 'zip', 97 'zip3', 'zipWith', 'zipWith3', 'unzip', 'unzip3', 98 'lines', 'words', 'unlines', 99 'unwords', 'showPrec', 'show', 'showList', 100 'shows', 'showChar', 'showString', 'showParen', 101 'readsPrec', 'readList', 'reads', 'readParen', 102 'read', 'lex', 'putChar', 'putStr', 'putStrLn', 103 'print', 'getChar', 'getLine', 'getContents', 104 'interact', 'readFile', 'writeFile', 'appendFile', 105 'readIO', 'readLn', 'ioError', 'userError', 'catch' 106 ), 107 /* here Prelude Types */ 108 4 => array ( 109 'Bool', 'Maybe', 'Either', 'Ord', 'Ordering', 110 'Char', 'String', 'Eq', 'Enum', 'Bounded', 111 'Int', 'Integer', 'Float', 'Double', 'Rational', 112 'Num', 'Real', 'Integral', 'Fractional', 113 'Floating', 'RealFrac', 'RealFloat', 'Monad', 114 'Functor', 'Show', 'ShowS', 'Read', 'ReadS', 115 'IO' 116 ), 117 /* finally Prelude Exceptions */ 118 5 => array ( 119 'IOError', 'IOException' 120 ) 121 ), 122 /* highlighting symbols is really important in Haskell */ 123 'SYMBOLS' => array( 124 '|', '->', '<-', '@', '!', '::', '_', '~', '=', '?', 125 '&&', '||', '==', '/=', '<', '<=', '>', 126 '>=','+', '-', '*','/', '%', '**', '^', '^^', 127 '>>=', '>>', '=<<', '$', '.', ',', '$!', 128 '++', '!!' 129 ), 130 'CASE_SENSITIVE' => array( 131 GESHI_COMMENTS => false, 132 1 => true, 133 2 => true, /* functions name are case seinsitive */ 134 3 => true, /* types name too */ 135 4 => true, /* finally exceptions too */ 136 5 => true 137 ), 138 'STYLES' => array( 139 'KEYWORDS' => array( 140 1 => 'color: #06c; font-weight: bold;', /* nice blue */ 141 2 => 'color: #06c; font-weight: bold;', /* blue as well */ 142 3 => 'font-weight: bold;', /* make the preduled functions bold */ 143 4 => 'color: #cccc00; font-weight: bold;', /* give types a different bg */ 144 5 => 'color: maroon;' 145 ), 146 'COMMENTS' => array( 147 1 => 'color: #5d478b; font-style: italic;', 148 2 => 'color: #339933; font-weight: bold;', 149 'MULTI' => 'color: #5d478b; font-style: italic;' /* light purpHle */ 150 ), 151 'ESCAPE_CHAR' => array( 152 0 => 'background-color: #3cb371; font-weight: bold;' 153 ), 154 'BRACKETS' => array( 155 0 => 'color: green;' 156 ), 157 'STRINGS' => array( 158 0 => 'background-color: #3cb371;' /* nice green */ 159 ), 160 'NUMBERS' => array( 161 0 => 'color: red;' /* pink */ 162 ), 163 'METHODS' => array( 164 1 => 'color: #060;' /* dark green */ 165 ), 166 'REGEXPS' => array( 167 ), 168 'SYMBOLS' => array( 169 0 => 'color: #339933; font-weight: bold;' 170 ), 171 'SCRIPT' => array( 172 ) 173 ), 174 'URLS' => array( 175 /* some of keywords are Prelude functions */ 176 1 => '', 177 /* link to the wanted library */ 178 2 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/{FNAME}.html', 179 /* link to Prelude functions */ 180 3 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:{FNAME}', 181 /* link to Prelude types */ 182 4 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}', 183 /* link to Prelude exceptions */ 184 5 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}', 185 ), 186 'OOLANG' => false, 187 'OBJECT_SPLITTERS' => array( 188 ), 189 'REGEXPS' => array( 190 ), 191 'STRICT_MODE_APPLIES' => GESHI_NEVER, 192 'SCRIPT_DELIMITERS' => array( 193 ), 194 'HIGHLIGHT_STRICT_BLOCK' => array( 195 ) 196 ); 197 198 ?> 199