KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

haskell.php 7.9KB

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