]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/vbnet.js
1 /*! `vbnet` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
6 Language: Visual Basic .NET
7 Description: Visual Basic .NET (VB.NET) is a multi-paradigm, object-oriented programming language, implemented on the .NET Framework.
8 Authors: Poren Chiang <ren.chiang@gmail.com>, Jan Pilzer
9 Website: https://docs.microsoft.com/dotnet/visual-basic/getting-started
13 /** @type LanguageFn */
14 function vbnet(hljs
) {
15 const regex
= hljs
.regex
;
18 * Either a single character ("a"C) or an escaped double quote (""""C).
22 begin: /"(""|[^/n
])"C\b/
32 // double quote escape
37 /** Date Literals consist of a date, a time, or both separated by whitespace, surrounded by # */
38 const MM_DD_YYYY = /\d{1,2}\/\d{1,2}\/\d{4}/;
39 const YYYY_MM_DD = /\d{4}-\d{1,2}-\d{1,2}/;
40 const TIME_12H = /(\d|1[012])(:\d+){0,2} *(AM|PM)/;
41 const TIME_24H = /\d{1,2}(:\d{1,2}){1,2}/;
46 // #YYYY-MM-DD# (ISO-Date) or #M/D/YYYY# (US-Date)
47 begin: regex.concat(/# */, regex.either(YYYY_MM_DD, MM_DD_YYYY), / *#/) },
49 // #H:mm[:ss]# (24h Time)
50 begin: regex.concat(/# */, TIME_24H, / *#/) },
52 // #h[:mm[:ss]] A# (12h Time)
53 begin: regex.concat(/# */, TIME_12H, / *#/) },
58 regex.either(YYYY_MM_DD, MM_DD_YYYY),
60 regex.either(TIME_12H, TIME_24H),
72 begin: /\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ },
75 begin: /\b\d[\d_]*((U?[SIL])|[%&])?/ },
78 begin: /&H[\dA-F_]+((U?[SIL])|[%&])?/ },
81 begin: /&O[0-7_]+((U?[SIL])|[%&])?/ },
84 begin: /&B[01_]+((U?[SIL])|[%&])?/ }
93 const DOC_COMMENT = hljs.COMMENT(/'''/, /$/, { contains: [
101 const COMMENT = hljs.COMMENT(null, /$/, { variants: [
104 // TODO: Use multi-class for leading spaces
105 begin: /([\t ]|^)REM(?=\s)/ }
110 // TODO: Use multi-class for indentation once available
111 begin: /[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,
114 'const disable else elseif enable end externalsource if region then' },
115 contains: [ COMMENT ]
119 name: 'Visual Basic .NET',
121 case_insensitive: true,
122 classNameAliases: { label: 'symbol' },
125 'addhandler alias aggregate ansi as async assembly auto binary by byref byval ' /* a-b */
126 + 'call case catch class compare const continue custom declare default delegate dim distinct do ' /* c-d */
127 + 'each equals else elseif end enum erase error event exit explicit finally for friend from function ' /* e-f */
128 + 'get global goto group handles if implements imports in inherits interface into iterator ' /* g-i */
129 + 'join key let lib loop me mid module mustinherit mustoverride mybase myclass ' /* j-m */
130 + 'namespace narrowing new next notinheritable notoverridable ' /* n */
131 + 'of off on operator option optional order overloads overridable overrides ' /* o */
132 + 'paramarray partial preserve private property protected public ' /* p */
133 + 'raiseevent readonly redim removehandler resume return ' /* r */
134 + 'select set shadows shared skip static step stop structure strict sub synclock ' /* s */
135 + 'take text then throw to try unicode until using when where while widening with withevents writeonly yield' /* t-y */,
137 // Operators https://docs.microsoft.com/dotnet/visual-basic/language-reference/operators
138 'addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor '
139 // Type Conversion Functions https://docs.microsoft.com/dotnet/visual-basic/language-reference/functions/type-conversion-functions
140 + 'cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort',
142 // Data types https://docs.microsoft.com/dotnet/visual-basic/language-reference/data-types
143 'boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort',
144 literal: 'true false nothing'
147 '//|\\{|\\}|endif|gosub|variant|wend|^\\$ ' /* reserved deprecated keywords */,
165 export default hljsGrammar;