Skip to content

Instantly share code, notes, and snippets.

@cprieto
Created December 22, 2009 18:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cprieto/261919 to your computer and use it in GitHub Desktop.
SyntaxHighlighter.brushes.Haskell = function()
{
var keywords = 'as case class of data default deriving do forall foreign ' +
'hiding if then else import infix infixl infixr instance ' +
'let in mdo module newtype qualified type where ';
var datatypes = 'Char String Bool Num Int Integer Float Eq Ord Read ' +
'Integral Fractional';
var special = 'True False otherwise not';
this.regexList = [
{ regex: /--(.*)$/gm, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1' },
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color2' },
];
}
SyntaxHighlighter.brushes.Haskell.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Haskell.aliases = ['haskell', 'hs'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment