vbnet.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Language: Visual Basic .NET
  3. Description: Visual Basic .NET (VB.NET) is a multi-paradigm, object-oriented programming language, implemented on the .NET Framework.
  4. Author: Poren Chiang <ren.chiang@gmail.com>
  5. Website: https://docs.microsoft.com/en-us/dotnet/visual-basic/getting-started/
  6. */
  7. function vbnet(hljs) {
  8. return {
  9. name: 'Visual Basic .NET',
  10. aliases: ['vb'],
  11. case_insensitive: true,
  12. keywords: {
  13. keyword:
  14. 'addhandler addressof alias and andalso aggregate ansi as async assembly auto await binary by byref byval ' + /* a-b */
  15. 'call case catch class compare const continue custom declare default delegate dim distinct do ' + /* c-d */
  16. 'each equals else elseif end enum erase error event exit explicit finally for friend from function ' + /* e-f */
  17. 'get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue iterator ' + /* g-i */
  18. 'join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass ' + /* j-m */
  19. 'nameof namespace narrowing new next not notinheritable notoverridable ' + /* n */
  20. 'of off on operator option optional or order orelse overloads overridable overrides ' + /* o */
  21. 'paramarray partial preserve private property protected public ' + /* p */
  22. 'raiseevent readonly redim rem removehandler resume return ' + /* r */
  23. 'select set shadows shared skip static step stop structure strict sub synclock ' + /* s */
  24. 'take text then throw to try unicode until using when where while widening with withevents writeonly xor yield', /* t-y */
  25. built_in:
  26. 'boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype ' + /* b-c */
  27. 'date decimal directcast double gettype getxmlnamespace iif integer long object ' + /* d-o */
  28. 'sbyte short single string trycast typeof uinteger ulong ushort', /* s-u */
  29. literal:
  30. 'true false nothing'
  31. },
  32. illegal: '//|{|}|endif|gosub|variant|wend|^\\$ ', /* reserved deprecated keywords */
  33. contains: [
  34. hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
  35. hljs.COMMENT(
  36. '\'',
  37. '$',
  38. {
  39. returnBegin: true,
  40. contains: [
  41. {
  42. className: 'doctag',
  43. begin: '\'\'\'|<!--|-->',
  44. contains: [hljs.PHRASAL_WORDS_MODE]
  45. },
  46. {
  47. className: 'doctag',
  48. begin: '</?', end: '>',
  49. contains: [hljs.PHRASAL_WORDS_MODE]
  50. }
  51. ]
  52. }
  53. ),
  54. hljs.C_NUMBER_MODE,
  55. {
  56. className: 'meta',
  57. begin: '#', end: '$',
  58. keywords: {'meta-keyword': 'if else elseif end region externalsource'}
  59. }
  60. ]
  61. };
  62. }
  63. module.exports = vbnet;