Syntax Highlight Brush for Erlang
Updated 13-Aug-09 -- use this version instead.
The trailing comma in line 13 is a bug. Remove it.
Following on from yesterday, Erlang;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//WTFPL licensed | |
dp.sh.Brushes.Erlang = function() | |
{ | |
var keywords = 'after begin case catch cond end fun if let of query receive when '+ | |
'define record export import include include_lib ifdef ifndef else endif undef '+ | |
'apply attribute call do in letrec module primop try'; | |
this.regexList = [ | |
{ regex: new RegExp('%.*$', 'gm'), css: 'comment' }, // one line comments | |
{ regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' }, // strings | |
{ regex: new RegExp(this.GetKeywords(keywords), 'g'), css: 'keyword' }, // Erlang keyword | |
{ regex: new RegExp('_?[A-Z]\\w*', 'g'), css: 'values'}, | |
{ regex: new RegExp('\\w+/\\d+', 'g'), css: 'funs'} // NO trailing comma | |
]; | |
this.CssClass = 'dp-erl'; | |
this.Style = '.dp-erl .values { color: #c88; font-weight: bold;} '+ | |
'.dp-erl .funs { color: #f00; } '; | |
} | |
dp.sh.Brushes.Erlang.prototype = new dp.sh.Highlighter(); | |
dp.sh.Brushes.Erlang.Aliases = ['erlang', 'erl']; |
No comments :
Post a Comment