PageRenderTime 22ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/Scripts/syntaxhighlighter/shBrushErlang.js

#
JavaScript | 52 lines | 24 code | 6 blank | 22 comment | 3 complexity | 112da02c9c7c83494f3764540aec6cdd MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. /**
  2. * SyntaxHighlighter
  3. * http://alexgorbatchev.com/SyntaxHighlighter
  4. *
  5. * SyntaxHighlighter is donationware. If you are using it, please donate.
  6. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  7. *
  8. * @version
  9. * 3.0.83 (July 02 2010)
  10. *
  11. * @copyright
  12. * Copyright (C) 2004-2010 Alex Gorbatchev.
  13. *
  14. * @license
  15. * Dual licensed under the MIT and GPL licenses.
  16. */
  17. ;(function()
  18. {
  19. // CommonJS
  20. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  21. function Brush()
  22. {
  23. // Contributed by Jean-Lou Dupont
  24. // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
  25. // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
  26. var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
  27. 'case catch cond div end fun if let not of or orelse '+
  28. 'query receive rem try when xor'+
  29. // additional
  30. ' module export import define';
  31. this.regexList = [
  32. { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
  33. { regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
  34. { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
  35. { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
  36. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
  37. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
  38. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
  39. ];
  40. };
  41. Brush.prototype = new SyntaxHighlighter.Highlighter();
  42. Brush.aliases = ['erl', 'erlang'];
  43. SyntaxHighlighter.brushes.Erland = Brush;
  44. // CommonJS
  45. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  46. })();