Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/tags/syntax/geshi/geshi/haskell.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Oliver Lillie  >  PHP Custom Tags  >  examples/tags/syntax/geshi/geshi/haskell.php  >  Download  
File: examples/tags/syntax/geshi/geshi/haskell.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Custom Tags
Template engine based on tags similar to HTML
Author: By
Last change:
Date: 1 year ago
Size: 7,970 bytes
 

Contents

Class file image Download
<?php
/*************************************************************************************
 * haskell.php
 * ----------
 * Author: Jason Dagit (dagit@codersbase.com) based on ocaml.php by Flaie (fireflaie@gmail.com)
 * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
 * Release Version: 1\.0\.8
 * Date Started: 2005/08/27
 *
 * Haskell language file for GeSHi.
 *
 * CHANGES
 * -------
 * 2005/08/27 (1.0.0)
 *   -  First Release
 *
 * TODO (updated 2005/08/27)
 * -------------------------
 *
 *************************************************************************************
 *
 *   This file is part of GeSHi.
 *
 *   GeSHi is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   GeSHi is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with GeSHi; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ************************************************************************************/

$language_data = array (
    
'LANG_NAME' => 'Haskell',
    
'COMMENT_SINGLE' => array( => '--'),
    
'COMMENT_MULTI' => array('{-' => '-}'),
    
'COMMENT_REGEXP' => array(=> "/-->/"),
    
'CASE_KEYWORDS' => 0,
    
'QUOTEMARKS' => array('"'),
    
'ESCAPE_CHAR' => "\\",
    
'KEYWORDS' => array(
        
/* main haskell keywords */
        
=> array(
            
'as',
            
'case''of''class''data''default',
            
'deriving''do''forall''hiding''if''then',
            
'else''import''infix''infixl''infixr',
            
'instance''let''in''module''newtype',
            
'qualified''type''where'
            
),
        
/* define names of main librarys, so we can link to it */
        
=> array(
            
'Foreign''Numeric''Prelude'
            
),
        
/* just link to Prelude functions, cause it's the default opened library when starting Haskell */
        
=> array(
            
'not''otherwise''maybe',
            
'either''fst''snd''curry''uncurry',
            
'compare',
            
'max''min''succ''pred''toEnum''fromEnum',
            
'enumFrom''enumFromThen''enumFromTo',
            
'enumFromThenTo''minBound''maxBound',
            
'negate''abs''signum',
            
'fromInteger''toRational''quot''rem',
            
'div''mod''quotRem''divMod''toInteger',
            
'recip''fromRational''pi''exp',
            
'log''sqrt''logBase''sin''cos',
            
'tan''asin''acos''atan''sinh''cosh',
            
'tanh''asinh''acosh''atanh',
            
'properFraction''truncate''round''ceiling',
            
'floor''floatRadix''floatDigits''floatRange',
            
'decodeFloat''encodeFloat''exponent',
            
'significand''scaleFloat''isNaN''isInfinite',
            
'isDenomalized''isNegativeZero''isIEEE',
            
'atan2''subtract''even''odd''gcd',
            
'lcm''fromIntegral''realToFrac',
            
'return''fail''fmap',
            
'mapM''mapM_''sequence''sequence_',
            
'id''const','flip',
            
'until''asTypeOf''error''undefined',
            
'seq','map','filter''head',
            
'last''tail''init''null''length',
            
'reverse''foldl''foldl1''foldr',
            
'foldr1''and''or''any''all''sum',
            
'product''concat''concatMap''maximum',
            
'minimum''scanl''scanl1''scanr''scanr1',
            
'iterate''repeat''cycle''take''drop',
            
'splitAt''teakWhile''dropWhile''span',
            
'break''elem''notElem''lookup''zip',
            
'zip3''zipWith''zipWith3''unzip''unzip3',
            
'lines''words''unlines',
            
'unwords''showPrec''show''showList',
            
'shows''showChar''showString''showParen',
            
'readsPrec''readList''reads''readParen',
            
'read''lex''putChar''putStr''putStrLn',
            
'print''getChar''getLine''getContents',
            
'interact''readFile''writeFile''appendFile',
            
'readIO''readLn''ioError''userError''catch'
            
),
        
/* here Prelude Types */
        
=> array (
            
'Bool''Maybe''Either''Ord''Ordering',
            
'Char''String''Eq''Enum''Bounded',
            
'Int''Integer''Float''Double''Rational',
            
'Num''Real''Integral''Fractional',
            
'Floating''RealFrac''RealFloat''Monad',
            
'Functor''Show''ShowS''Read''ReadS',
            
'IO'
            
),
        
/* finally Prelude Exceptions */
        
=> array (
            
'IOError''IOException'
            
)
        ),
    
/* highlighting symbols is really important in Haskell */
    
'SYMBOLS' => array(
        
'|''->''<-''@''!''::''_''~''=''?',
        
'&&''||''==''/=''<''<=''>',
        
'>=','+''-''*','/''%''**''^''^^',
        
'>>=''>>''=<<',  '$''.'',''$!',
        
'++''!!'
        
),
    
'CASE_SENSITIVE' => array(
        
GESHI_COMMENTS => false,
        
=> true,
        
=> true/* functions name are case seinsitive */
        
=> true/* types name too */
        
=> true/* finally exceptions too */
        
=> true
        
),
    
'STYLES' => array(
        
'KEYWORDS' => array(
            
=> 'color: #06c; font-weight: bold;'/* nice blue */
            
=> 'color: #06c; font-weight: bold;'/* blue as well */
            
=> 'font-weight: bold;'/* make the preduled functions bold */
            
=> 'color: #cccc00; font-weight: bold;'/* give types a different bg */
            
=> 'color: maroon;'
            
),
        
'COMMENTS' => array(
            
=> 'color: #5d478b; font-style: italic;',
            
=> 'color: #339933; font-weight: bold;',
            
'MULTI' => 'color: #5d478b; font-style: italic;' /* light purpHle */
            
),
        
'ESCAPE_CHAR' => array(
            
=> 'background-color: #3cb371; font-weight: bold;'
            
),
        
'BRACKETS' => array(
            
=> 'color: green;'
            
),
        
'STRINGS' => array(
            
=> 'background-color: #3cb371;' /* nice green */
            
),
        
'NUMBERS' => array(
            
=> 'color: red;' /* pink */
            
),
        
'METHODS' => array(
            
=> 'color: #060;' /* dark green */
            
),
        
'REGEXPS' => array(
            ),
        
'SYMBOLS' => array(
            
=> 'color: #339933; font-weight: bold;'
            
),
        
'SCRIPT' => array(
            )
        ),
    
'URLS' => array(
        
/* some of keywords are Prelude functions */
        
=> '',
        
/* link to the wanted library */
        
=> 'http://haskell.org/ghc/docs/latest/html/libraries/base/{FNAME}.html',
        
/* link to Prelude functions */
        
=> 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:{FNAME}',
        
/* link to Prelude types */
        
=> 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}',
        
/* link to Prelude exceptions */
        
=> 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}',
        ),
    
'OOLANG' => false,
    
'OBJECT_SPLITTERS' => array(
        ),
    
'REGEXPS' => array(
        ),
    
'STRICT_MODE_APPLIES' => GESHI_NEVER,
    
'SCRIPT_DELIMITERS' => array(
        ),
    
'HIGHLIGHT_STRICT_BLOCK' => array(
        )
);

?>