PageRenderTime 44ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/Scripts/syntaxhighlighter/shBrushJScript.js

#
JavaScript | 52 lines | 27 code | 7 blank | 18 comment | 6 complexity | 47c8226b5013204a3da14359aa2c2da4 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. var keywords = 'break case catch continue ' +
  24. 'default delete do else false ' +
  25. 'for function if in instanceof ' +
  26. 'new null return super switch ' +
  27. 'this throw true try typeof var while with'
  28. ;
  29. var r = SyntaxHighlighter.regexLib;
  30. this.regexList = [
  31. { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
  32. { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
  33. { regex: r.singleLineCComments, css: 'comments' }, // one line comments
  34. { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
  35. { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
  36. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
  37. ];
  38. this.forHtmlScript(r.scriptScriptTags);
  39. };
  40. Brush.prototype = new SyntaxHighlighter.Highlighter();
  41. Brush.aliases = ['js', 'jscript', 'javascript'];
  42. SyntaxHighlighter.brushes.JScript = Brush;
  43. // CommonJS
  44. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  45. })();