PageRenderTime 59ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/syntaxhighlighter_3.0.83/scripts/shBrushJavaFX.js

#
JavaScript | 58 lines | 32 code | 6 blank | 20 comment | 6 complexity | 0afafd1298c5870e7f3bf8ab761ccb6e 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 Patrick Webster
  24. // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
  25. var datatypes = 'Boolean Byte Character Double Duration '
  26. + 'Float Integer Long Number Short String Void'
  27. ;
  28. var keywords = 'abstract after and as assert at before bind bound break catch class '
  29. + 'continue def delete else exclusive extends false finally first for from '
  30. + 'function if import in indexof init insert instanceof into inverse last '
  31. + 'lazy mixin mod nativearray new not null on or override package postinit '
  32. + 'protected public public-init public-read replace return reverse sizeof '
  33. + 'step super then this throw true try tween typeof var where while with '
  34. + 'attribute let private readonly static trigger'
  35. ;
  36. this.regexList = [
  37. { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
  38. { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
  39. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
  40. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
  41. { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
  42. { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
  43. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
  44. ];
  45. this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
  46. };
  47. Brush.prototype = new SyntaxHighlighter.Highlighter();
  48. Brush.aliases = ['jfx', 'javafx'];
  49. SyntaxHighlighter.brushes.JavaFX = Brush;
  50. // CommonJS
  51. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  52. })();