PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/syntaxhighlighter_3.0.83/scripts/shBrushVb.js

#
JavaScript | 56 lines | 32 code | 6 blank | 18 comment | 2 complexity | bb8a98a95fabbd96b6c94582716c57cd 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 = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
  24. 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
  25. 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
  26. 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
  27. 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
  28. 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
  29. 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
  30. 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
  31. 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
  32. 'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
  33. 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
  34. 'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
  35. 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
  36. 'Variant When While With WithEvents WriteOnly Xor';
  37. this.regexList = [
  38. { regex: /'.*$/gm, css: 'comments' }, // one line comments
  39. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
  40. { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
  41. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
  42. ];
  43. this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
  44. };
  45. Brush.prototype = new SyntaxHighlighter.Highlighter();
  46. Brush.aliases = ['vb', 'vbnet'];
  47. SyntaxHighlighter.brushes.Vb = Brush;
  48. // CommonJS
  49. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  50. })();