1;(function() 2{ 3 // CommonJS 4 SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 5 6 function Brush() 7 { 8 // Contributed by Jean-Lou Dupont 9 // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 10 11 // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 12 var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 13 'case catch cond div end fun if let not of or orelse '+ 14 'query receive rem try when xor'+ 15 // additional 16 ' module export import define'; 17 18 this.regexList = [ 19 { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 20 { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 21 { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 22 { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 23 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 24 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 25 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 26 ]; 27 }; 28 29 Brush.prototype = new SyntaxHighlighter.Highlighter(); 30 Brush.aliases = ['erl', 'erlang']; 31 32 SyntaxHighlighter.brushes.Erlang = Brush; 33 34 // CommonJS 35 typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 36})(); 37