A tumblelog CMS built on AJAX, PHP and MySQL.

haskell.php 7.6KB

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