vb.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*!-----------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Version: 0.31.1(337587859b1c171314b40503171188b6cea6a32a)
  4. * Released under the MIT license
  5. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  6. *-----------------------------------------------------------------------------*/
  7. define("vs/basic-languages/vb/vb",[],()=>{
  8. var moduleExports = (() => {
  9. var __defProp = Object.defineProperty;
  10. var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
  11. var __export = (target, all) => {
  12. __markAsModule(target);
  13. for (var name in all)
  14. __defProp(target, name, { get: all[name], enumerable: true });
  15. };
  16. // src/basic-languages/vb/vb.ts
  17. var vb_exports = {};
  18. __export(vb_exports, {
  19. conf: () => conf,
  20. language: () => language
  21. });
  22. var conf = {
  23. comments: {
  24. lineComment: "'",
  25. blockComment: ["/*", "*/"]
  26. },
  27. brackets: [
  28. ["{", "}"],
  29. ["[", "]"],
  30. ["(", ")"],
  31. ["<", ">"],
  32. ["addhandler", "end addhandler"],
  33. ["class", "end class"],
  34. ["enum", "end enum"],
  35. ["event", "end event"],
  36. ["function", "end function"],
  37. ["get", "end get"],
  38. ["if", "end if"],
  39. ["interface", "end interface"],
  40. ["module", "end module"],
  41. ["namespace", "end namespace"],
  42. ["operator", "end operator"],
  43. ["property", "end property"],
  44. ["raiseevent", "end raiseevent"],
  45. ["removehandler", "end removehandler"],
  46. ["select", "end select"],
  47. ["set", "end set"],
  48. ["structure", "end structure"],
  49. ["sub", "end sub"],
  50. ["synclock", "end synclock"],
  51. ["try", "end try"],
  52. ["while", "end while"],
  53. ["with", "end with"],
  54. ["using", "end using"],
  55. ["do", "loop"],
  56. ["for", "next"]
  57. ],
  58. autoClosingPairs: [
  59. { open: "{", close: "}", notIn: ["string", "comment"] },
  60. { open: "[", close: "]", notIn: ["string", "comment"] },
  61. { open: "(", close: ")", notIn: ["string", "comment"] },
  62. { open: '"', close: '"', notIn: ["string", "comment"] },
  63. { open: "<", close: ">", notIn: ["string", "comment"] }
  64. ],
  65. folding: {
  66. markers: {
  67. start: new RegExp("^\\s*#Region\\b"),
  68. end: new RegExp("^\\s*#End Region\\b")
  69. }
  70. }
  71. };
  72. var language = {
  73. defaultToken: "",
  74. tokenPostfix: ".vb",
  75. ignoreCase: true,
  76. brackets: [
  77. { token: "delimiter.bracket", open: "{", close: "}" },
  78. { token: "delimiter.array", open: "[", close: "]" },
  79. { token: "delimiter.parenthesis", open: "(", close: ")" },
  80. { token: "delimiter.angle", open: "<", close: ">" },
  81. {
  82. token: "keyword.tag-addhandler",
  83. open: "addhandler",
  84. close: "end addhandler"
  85. },
  86. { token: "keyword.tag-class", open: "class", close: "end class" },
  87. { token: "keyword.tag-enum", open: "enum", close: "end enum" },
  88. { token: "keyword.tag-event", open: "event", close: "end event" },
  89. {
  90. token: "keyword.tag-function",
  91. open: "function",
  92. close: "end function"
  93. },
  94. { token: "keyword.tag-get", open: "get", close: "end get" },
  95. { token: "keyword.tag-if", open: "if", close: "end if" },
  96. {
  97. token: "keyword.tag-interface",
  98. open: "interface",
  99. close: "end interface"
  100. },
  101. { token: "keyword.tag-module", open: "module", close: "end module" },
  102. {
  103. token: "keyword.tag-namespace",
  104. open: "namespace",
  105. close: "end namespace"
  106. },
  107. {
  108. token: "keyword.tag-operator",
  109. open: "operator",
  110. close: "end operator"
  111. },
  112. {
  113. token: "keyword.tag-property",
  114. open: "property",
  115. close: "end property"
  116. },
  117. {
  118. token: "keyword.tag-raiseevent",
  119. open: "raiseevent",
  120. close: "end raiseevent"
  121. },
  122. {
  123. token: "keyword.tag-removehandler",
  124. open: "removehandler",
  125. close: "end removehandler"
  126. },
  127. { token: "keyword.tag-select", open: "select", close: "end select" },
  128. { token: "keyword.tag-set", open: "set", close: "end set" },
  129. {
  130. token: "keyword.tag-structure",
  131. open: "structure",
  132. close: "end structure"
  133. },
  134. { token: "keyword.tag-sub", open: "sub", close: "end sub" },
  135. {
  136. token: "keyword.tag-synclock",
  137. open: "synclock",
  138. close: "end synclock"
  139. },
  140. { token: "keyword.tag-try", open: "try", close: "end try" },
  141. { token: "keyword.tag-while", open: "while", close: "end while" },
  142. { token: "keyword.tag-with", open: "with", close: "end with" },
  143. { token: "keyword.tag-using", open: "using", close: "end using" },
  144. { token: "keyword.tag-do", open: "do", close: "loop" },
  145. { token: "keyword.tag-for", open: "for", close: "next" }
  146. ],
  147. keywords: [
  148. "AddHandler",
  149. "AddressOf",
  150. "Alias",
  151. "And",
  152. "AndAlso",
  153. "As",
  154. "Async",
  155. "Boolean",
  156. "ByRef",
  157. "Byte",
  158. "ByVal",
  159. "Call",
  160. "Case",
  161. "Catch",
  162. "CBool",
  163. "CByte",
  164. "CChar",
  165. "CDate",
  166. "CDbl",
  167. "CDec",
  168. "Char",
  169. "CInt",
  170. "Class",
  171. "CLng",
  172. "CObj",
  173. "Const",
  174. "Continue",
  175. "CSByte",
  176. "CShort",
  177. "CSng",
  178. "CStr",
  179. "CType",
  180. "CUInt",
  181. "CULng",
  182. "CUShort",
  183. "Date",
  184. "Decimal",
  185. "Declare",
  186. "Default",
  187. "Delegate",
  188. "Dim",
  189. "DirectCast",
  190. "Do",
  191. "Double",
  192. "Each",
  193. "Else",
  194. "ElseIf",
  195. "End",
  196. "EndIf",
  197. "Enum",
  198. "Erase",
  199. "Error",
  200. "Event",
  201. "Exit",
  202. "False",
  203. "Finally",
  204. "For",
  205. "Friend",
  206. "Function",
  207. "Get",
  208. "GetType",
  209. "GetXMLNamespace",
  210. "Global",
  211. "GoSub",
  212. "GoTo",
  213. "Handles",
  214. "If",
  215. "Implements",
  216. "Imports",
  217. "In",
  218. "Inherits",
  219. "Integer",
  220. "Interface",
  221. "Is",
  222. "IsNot",
  223. "Let",
  224. "Lib",
  225. "Like",
  226. "Long",
  227. "Loop",
  228. "Me",
  229. "Mod",
  230. "Module",
  231. "MustInherit",
  232. "MustOverride",
  233. "MyBase",
  234. "MyClass",
  235. "NameOf",
  236. "Namespace",
  237. "Narrowing",
  238. "New",
  239. "Next",
  240. "Not",
  241. "Nothing",
  242. "NotInheritable",
  243. "NotOverridable",
  244. "Object",
  245. "Of",
  246. "On",
  247. "Operator",
  248. "Option",
  249. "Optional",
  250. "Or",
  251. "OrElse",
  252. "Out",
  253. "Overloads",
  254. "Overridable",
  255. "Overrides",
  256. "ParamArray",
  257. "Partial",
  258. "Private",
  259. "Property",
  260. "Protected",
  261. "Public",
  262. "RaiseEvent",
  263. "ReadOnly",
  264. "ReDim",
  265. "RemoveHandler",
  266. "Resume",
  267. "Return",
  268. "SByte",
  269. "Select",
  270. "Set",
  271. "Shadows",
  272. "Shared",
  273. "Short",
  274. "Single",
  275. "Static",
  276. "Step",
  277. "Stop",
  278. "String",
  279. "Structure",
  280. "Sub",
  281. "SyncLock",
  282. "Then",
  283. "Throw",
  284. "To",
  285. "True",
  286. "Try",
  287. "TryCast",
  288. "TypeOf",
  289. "UInteger",
  290. "ULong",
  291. "UShort",
  292. "Using",
  293. "Variant",
  294. "Wend",
  295. "When",
  296. "While",
  297. "Widening",
  298. "With",
  299. "WithEvents",
  300. "WriteOnly",
  301. "Xor"
  302. ],
  303. tagwords: [
  304. "If",
  305. "Sub",
  306. "Select",
  307. "Try",
  308. "Class",
  309. "Enum",
  310. "Function",
  311. "Get",
  312. "Interface",
  313. "Module",
  314. "Namespace",
  315. "Operator",
  316. "Set",
  317. "Structure",
  318. "Using",
  319. "While",
  320. "With",
  321. "Do",
  322. "Loop",
  323. "For",
  324. "Next",
  325. "Property",
  326. "Continue",
  327. "AddHandler",
  328. "RemoveHandler",
  329. "Event",
  330. "RaiseEvent",
  331. "SyncLock"
  332. ],
  333. symbols: /[=><!~?;\.,:&|+\-*\/\^%]+/,
  334. integersuffix: /U?[DI%L&S@]?/,
  335. floatsuffix: /[R#F!]?/,
  336. tokenizer: {
  337. root: [
  338. { include: "@whitespace" },
  339. [/next(?!\w)/, { token: "keyword.tag-for" }],
  340. [/loop(?!\w)/, { token: "keyword.tag-do" }],
  341. [
  342. /end\s+(?!for|do)(addhandler|class|enum|event|function|get|if|interface|module|namespace|operator|property|raiseevent|removehandler|select|set|structure|sub|synclock|try|while|with|using)/,
  343. { token: "keyword.tag-$1" }
  344. ],
  345. [
  346. /[a-zA-Z_]\w*/,
  347. {
  348. cases: {
  349. "@tagwords": { token: "keyword.tag-$0" },
  350. "@keywords": { token: "keyword.$0" },
  351. "@default": "identifier"
  352. }
  353. }
  354. ],
  355. [/^\s*#\w+/, "keyword"],
  356. [/\d*\d+e([\-+]?\d+)?(@floatsuffix)/, "number.float"],
  357. [/\d*\.\d+(e[\-+]?\d+)?(@floatsuffix)/, "number.float"],
  358. [/&H[0-9a-f]+(@integersuffix)/, "number.hex"],
  359. [/&0[0-7]+(@integersuffix)/, "number.octal"],
  360. [/\d+(@integersuffix)/, "number"],
  361. [/#.*#/, "number"],
  362. [/[{}()\[\]]/, "@brackets"],
  363. [/@symbols/, "delimiter"],
  364. [/["\u201c\u201d]/, { token: "string.quote", next: "@string" }]
  365. ],
  366. whitespace: [
  367. [/[ \t\r\n]+/, ""],
  368. [/(\'|REM(?!\w)).*$/, "comment"]
  369. ],
  370. string: [
  371. [/[^"\u201c\u201d]+/, "string"],
  372. [/["\u201c\u201d]{2}/, "string.escape"],
  373. [/["\u201c\u201d]C?/, { token: "string.quote", next: "@pop" }]
  374. ]
  375. }
  376. };
  377. return vb_exports;
  378. })();
  379. return moduleExports;
  380. });