Diligent web site
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shBrushJScript.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * SyntaxHighlighter
  3. * http://alexgorbatchev.com/
  4. *
  5. * SyntaxHighlighter is donationware. If you are using it, please donate.
  6. * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
  7. *
  8. * @version
  9. * 2.0.296 (March 01 2009)
  10. *
  11. * @copyright
  12. * Copyright (C) 2004-2009 Alex Gorbatchev.
  13. *
  14. * @license
  15. * This file is part of SyntaxHighlighter.
  16. *
  17. * SyntaxHighlighter is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License as published by
  19. * the Free Software Foundation, either version 3 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * SyntaxHighlighter is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
  29. */
  30. SyntaxHighlighter.brushes.JScript = function()
  31. {
  32. var keywords = 'abstract boolean break byte case catch char class const continue debugger ' +
  33. 'default delete do double else enum export extends false final finally float ' +
  34. 'for function goto if implements import in instanceof int interface long native ' +
  35. 'new null package private protected public return short static super switch ' +
  36. 'synchronized this throw throws transient true try typeof var void volatile while with';
  37. this.regexList = [
  38. { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
  39. { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
  40. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
  41. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
  42. { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
  43. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
  44. ];
  45. this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
  46. };
  47. SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
  48. SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];