shBrushVb.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. })();