6d939a86705d972e2551dde794571e7052a2fc8c25382126f6623ba5bb2105ec78f8da40eb59f0810b307dd3837b389c87163e796739dc8f435182c133c89c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. "use strict";
  2. /*!-----------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
  5. * Released under the MIT license
  6. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  7. *-----------------------------------------------------------------------------*/
  8. define("vs/basic-languages/razor/razor", ["require"],(require)=>{
  9. var moduleExports = (() => {
  10. var __create = Object.create;
  11. var __defProp = Object.defineProperty;
  12. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  13. var __getOwnPropNames = Object.getOwnPropertyNames;
  14. var __getProtoOf = Object.getPrototypeOf;
  15. var __hasOwnProp = Object.prototype.hasOwnProperty;
  16. var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
  17. get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
  18. }) : x)(function(x) {
  19. if (typeof require !== "undefined")
  20. return require.apply(this, arguments);
  21. throw new Error('Dynamic require of "' + x + '" is not supported');
  22. });
  23. var __commonJS = (cb, mod) => function __require2() {
  24. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  25. };
  26. var __export = (target, all) => {
  27. for (var name in all)
  28. __defProp(target, name, { get: all[name], enumerable: true });
  29. };
  30. var __copyProps = (to, from, except, desc) => {
  31. if (from && typeof from === "object" || typeof from === "function") {
  32. for (let key of __getOwnPropNames(from))
  33. if (!__hasOwnProp.call(to, key) && key !== except)
  34. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  35. }
  36. return to;
  37. };
  38. var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
  39. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
  40. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  41. // src/fillers/monaco-editor-core-amd.ts
  42. var require_monaco_editor_core_amd = __commonJS({
  43. "src/fillers/monaco-editor-core-amd.ts"(exports, module) {
  44. var api = __toESM(__require("vs/editor/editor.api"));
  45. module.exports = api;
  46. }
  47. });
  48. // src/basic-languages/razor/razor.ts
  49. var razor_exports = {};
  50. __export(razor_exports, {
  51. conf: () => conf,
  52. language: () => language
  53. });
  54. // src/fillers/monaco-editor-core.ts
  55. var monaco_editor_core_exports = {};
  56. __reExport(monaco_editor_core_exports, __toESM(require_monaco_editor_core_amd()));
  57. // src/basic-languages/razor/razor.ts
  58. var EMPTY_ELEMENTS = [
  59. "area",
  60. "base",
  61. "br",
  62. "col",
  63. "embed",
  64. "hr",
  65. "img",
  66. "input",
  67. "keygen",
  68. "link",
  69. "menuitem",
  70. "meta",
  71. "param",
  72. "source",
  73. "track",
  74. "wbr"
  75. ];
  76. var conf = {
  77. wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
  78. comments: {
  79. blockComment: ["<!--", "-->"]
  80. },
  81. brackets: [
  82. ["<!--", "-->"],
  83. ["<", ">"],
  84. ["{", "}"],
  85. ["(", ")"]
  86. ],
  87. autoClosingPairs: [
  88. { open: "{", close: "}" },
  89. { open: "[", close: "]" },
  90. { open: "(", close: ")" },
  91. { open: '"', close: '"' },
  92. { open: "'", close: "'" }
  93. ],
  94. surroundingPairs: [
  95. { open: '"', close: '"' },
  96. { open: "'", close: "'" },
  97. { open: "<", close: ">" }
  98. ],
  99. onEnterRules: [
  100. {
  101. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  102. afterText: /^<\/(\w[\w\d]*)\s*>$/i,
  103. action: {
  104. indentAction: monaco_editor_core_exports.languages.IndentAction.IndentOutdent
  105. }
  106. },
  107. {
  108. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  109. action: { indentAction: monaco_editor_core_exports.languages.IndentAction.Indent }
  110. }
  111. ]
  112. };
  113. var language = {
  114. defaultToken: "",
  115. tokenPostfix: "",
  116. tokenizer: {
  117. root: [
  118. [/@@@@/],
  119. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.root" }],
  120. [/<!DOCTYPE/, "metatag.html", "@doctype"],
  121. [/<!--/, "comment.html", "@comment"],
  122. [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  123. [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
  124. [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
  125. [/(<)([:\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  126. [/(<\/)([\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  127. [/</, "delimiter.html"],
  128. [/[ \t\r\n]+/],
  129. [/[^<@]+/]
  130. ],
  131. doctype: [
  132. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
  133. [/[^>]+/, "metatag.content.html"],
  134. [/>/, "metatag.html", "@pop"]
  135. ],
  136. comment: [
  137. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
  138. [/-->/, "comment.html", "@pop"],
  139. [/[^-]+/, "comment.content.html"],
  140. [/./, "comment.content.html"]
  141. ],
  142. otherTag: [
  143. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.otherTag" }],
  144. [/\/?>/, "delimiter.html", "@pop"],
  145. [/"([^"]*)"/, "attribute.value"],
  146. [/'([^']*)'/, "attribute.value"],
  147. [/[\w\-]+/, "attribute.name"],
  148. [/=/, "delimiter"],
  149. [/[ \t\r\n]+/]
  150. ],
  151. script: [
  152. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.script" }],
  153. [/type/, "attribute.name", "@scriptAfterType"],
  154. [/"([^"]*)"/, "attribute.value"],
  155. [/'([^']*)'/, "attribute.value"],
  156. [/[\w\-]+/, "attribute.name"],
  157. [/=/, "delimiter"],
  158. [
  159. />/,
  160. {
  161. token: "delimiter.html",
  162. next: "@scriptEmbedded.text/javascript",
  163. nextEmbedded: "text/javascript"
  164. }
  165. ],
  166. [/[ \t\r\n]+/],
  167. [
  168. /(<\/)(script\s*)(>)/,
  169. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  170. ]
  171. ],
  172. scriptAfterType: [
  173. [
  174. /@[^@]/,
  175. {
  176. token: "@rematch",
  177. switchTo: "@razorInSimpleState.scriptAfterType"
  178. }
  179. ],
  180. [/=/, "delimiter", "@scriptAfterTypeEquals"],
  181. [
  182. />/,
  183. {
  184. token: "delimiter.html",
  185. next: "@scriptEmbedded.text/javascript",
  186. nextEmbedded: "text/javascript"
  187. }
  188. ],
  189. [/[ \t\r\n]+/],
  190. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  191. ],
  192. scriptAfterTypeEquals: [
  193. [
  194. /@[^@]/,
  195. {
  196. token: "@rematch",
  197. switchTo: "@razorInSimpleState.scriptAfterTypeEquals"
  198. }
  199. ],
  200. [
  201. /"([^"]*)"/,
  202. {
  203. token: "attribute.value",
  204. switchTo: "@scriptWithCustomType.$1"
  205. }
  206. ],
  207. [
  208. /'([^']*)'/,
  209. {
  210. token: "attribute.value",
  211. switchTo: "@scriptWithCustomType.$1"
  212. }
  213. ],
  214. [
  215. />/,
  216. {
  217. token: "delimiter.html",
  218. next: "@scriptEmbedded.text/javascript",
  219. nextEmbedded: "text/javascript"
  220. }
  221. ],
  222. [/[ \t\r\n]+/],
  223. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  224. ],
  225. scriptWithCustomType: [
  226. [
  227. /@[^@]/,
  228. {
  229. token: "@rematch",
  230. switchTo: "@razorInSimpleState.scriptWithCustomType.$S2"
  231. }
  232. ],
  233. [
  234. />/,
  235. {
  236. token: "delimiter.html",
  237. next: "@scriptEmbedded.$S2",
  238. nextEmbedded: "$S2"
  239. }
  240. ],
  241. [/"([^"]*)"/, "attribute.value"],
  242. [/'([^']*)'/, "attribute.value"],
  243. [/[\w\-]+/, "attribute.name"],
  244. [/=/, "delimiter"],
  245. [/[ \t\r\n]+/],
  246. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  247. ],
  248. scriptEmbedded: [
  249. [
  250. /@[^@]/,
  251. {
  252. token: "@rematch",
  253. switchTo: "@razorInEmbeddedState.scriptEmbedded.$S2",
  254. nextEmbedded: "@pop"
  255. }
  256. ],
  257. [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  258. ],
  259. style: [
  260. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.style" }],
  261. [/type/, "attribute.name", "@styleAfterType"],
  262. [/"([^"]*)"/, "attribute.value"],
  263. [/'([^']*)'/, "attribute.value"],
  264. [/[\w\-]+/, "attribute.name"],
  265. [/=/, "delimiter"],
  266. [
  267. />/,
  268. {
  269. token: "delimiter.html",
  270. next: "@styleEmbedded.text/css",
  271. nextEmbedded: "text/css"
  272. }
  273. ],
  274. [/[ \t\r\n]+/],
  275. [
  276. /(<\/)(style\s*)(>)/,
  277. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  278. ]
  279. ],
  280. styleAfterType: [
  281. [
  282. /@[^@]/,
  283. {
  284. token: "@rematch",
  285. switchTo: "@razorInSimpleState.styleAfterType"
  286. }
  287. ],
  288. [/=/, "delimiter", "@styleAfterTypeEquals"],
  289. [
  290. />/,
  291. {
  292. token: "delimiter.html",
  293. next: "@styleEmbedded.text/css",
  294. nextEmbedded: "text/css"
  295. }
  296. ],
  297. [/[ \t\r\n]+/],
  298. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  299. ],
  300. styleAfterTypeEquals: [
  301. [
  302. /@[^@]/,
  303. {
  304. token: "@rematch",
  305. switchTo: "@razorInSimpleState.styleAfterTypeEquals"
  306. }
  307. ],
  308. [
  309. /"([^"]*)"/,
  310. {
  311. token: "attribute.value",
  312. switchTo: "@styleWithCustomType.$1"
  313. }
  314. ],
  315. [
  316. /'([^']*)'/,
  317. {
  318. token: "attribute.value",
  319. switchTo: "@styleWithCustomType.$1"
  320. }
  321. ],
  322. [
  323. />/,
  324. {
  325. token: "delimiter.html",
  326. next: "@styleEmbedded.text/css",
  327. nextEmbedded: "text/css"
  328. }
  329. ],
  330. [/[ \t\r\n]+/],
  331. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  332. ],
  333. styleWithCustomType: [
  334. [
  335. /@[^@]/,
  336. {
  337. token: "@rematch",
  338. switchTo: "@razorInSimpleState.styleWithCustomType.$S2"
  339. }
  340. ],
  341. [
  342. />/,
  343. {
  344. token: "delimiter.html",
  345. next: "@styleEmbedded.$S2",
  346. nextEmbedded: "$S2"
  347. }
  348. ],
  349. [/"([^"]*)"/, "attribute.value"],
  350. [/'([^']*)'/, "attribute.value"],
  351. [/[\w\-]+/, "attribute.name"],
  352. [/=/, "delimiter"],
  353. [/[ \t\r\n]+/],
  354. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  355. ],
  356. styleEmbedded: [
  357. [
  358. /@[^@]/,
  359. {
  360. token: "@rematch",
  361. switchTo: "@razorInEmbeddedState.styleEmbedded.$S2",
  362. nextEmbedded: "@pop"
  363. }
  364. ],
  365. [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  366. ],
  367. razorInSimpleState: [
  368. [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
  369. [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
  370. [/(@)(\s*[\w]+)/, ["metatag.cs", { token: "identifier.cs", switchTo: "@$S2.$S3" }]],
  371. [/[})]/, { token: "metatag.cs", switchTo: "@$S2.$S3" }],
  372. [/\*@/, { token: "comment.cs", switchTo: "@$S2.$S3" }]
  373. ],
  374. razorInEmbeddedState: [
  375. [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
  376. [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
  377. [
  378. /(@)(\s*[\w]+)/,
  379. [
  380. "metatag.cs",
  381. {
  382. token: "identifier.cs",
  383. switchTo: "@$S2.$S3",
  384. nextEmbedded: "$S3"
  385. }
  386. ]
  387. ],
  388. [
  389. /[})]/,
  390. {
  391. token: "metatag.cs",
  392. switchTo: "@$S2.$S3",
  393. nextEmbedded: "$S3"
  394. }
  395. ],
  396. [
  397. /\*@/,
  398. {
  399. token: "comment.cs",
  400. switchTo: "@$S2.$S3",
  401. nextEmbedded: "$S3"
  402. }
  403. ]
  404. ],
  405. razorBlockCommentTopLevel: [
  406. [/\*@/, "@rematch", "@pop"],
  407. [/[^*]+/, "comment.cs"],
  408. [/./, "comment.cs"]
  409. ],
  410. razorBlockComment: [
  411. [/\*@/, "comment.cs", "@pop"],
  412. [/[^*]+/, "comment.cs"],
  413. [/./, "comment.cs"]
  414. ],
  415. razorRootTopLevel: [
  416. [/\{/, "delimiter.bracket.cs", "@razorRoot"],
  417. [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
  418. [/[})]/, "@rematch", "@pop"],
  419. { include: "razorCommon" }
  420. ],
  421. razorRoot: [
  422. [/\{/, "delimiter.bracket.cs", "@razorRoot"],
  423. [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
  424. [/\}/, "delimiter.bracket.cs", "@pop"],
  425. [/\)/, "delimiter.parenthesis.cs", "@pop"],
  426. { include: "razorCommon" }
  427. ],
  428. razorCommon: [
  429. [
  430. /[a-zA-Z_]\w*/,
  431. {
  432. cases: {
  433. "@razorKeywords": { token: "keyword.cs" },
  434. "@default": "identifier.cs"
  435. }
  436. }
  437. ],
  438. [/[\[\]]/, "delimiter.array.cs"],
  439. [/[ \t\r\n]+/],
  440. [/\/\/.*$/, "comment.cs"],
  441. [/@\*/, "comment.cs", "@razorBlockComment"],
  442. [/"([^"]*)"/, "string.cs"],
  443. [/'([^']*)'/, "string.cs"],
  444. [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  445. [/(<)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  446. [/(<\/)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  447. [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/, "delimiter.cs"],
  448. [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.cs"],
  449. [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.cs"],
  450. [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.cs"],
  451. [/0[0-7']*[0-7]/, "number.octal.cs"],
  452. [/0[bB][0-1']*[0-1]/, "number.binary.cs"],
  453. [/\d[\d']*/, "number.cs"],
  454. [/\d/, "number.cs"]
  455. ]
  456. },
  457. razorKeywords: [
  458. "abstract",
  459. "as",
  460. "async",
  461. "await",
  462. "base",
  463. "bool",
  464. "break",
  465. "by",
  466. "byte",
  467. "case",
  468. "catch",
  469. "char",
  470. "checked",
  471. "class",
  472. "const",
  473. "continue",
  474. "decimal",
  475. "default",
  476. "delegate",
  477. "do",
  478. "double",
  479. "descending",
  480. "explicit",
  481. "event",
  482. "extern",
  483. "else",
  484. "enum",
  485. "false",
  486. "finally",
  487. "fixed",
  488. "float",
  489. "for",
  490. "foreach",
  491. "from",
  492. "goto",
  493. "group",
  494. "if",
  495. "implicit",
  496. "in",
  497. "int",
  498. "interface",
  499. "internal",
  500. "into",
  501. "is",
  502. "lock",
  503. "long",
  504. "nameof",
  505. "new",
  506. "null",
  507. "namespace",
  508. "object",
  509. "operator",
  510. "out",
  511. "override",
  512. "orderby",
  513. "params",
  514. "private",
  515. "protected",
  516. "public",
  517. "readonly",
  518. "ref",
  519. "return",
  520. "switch",
  521. "struct",
  522. "sbyte",
  523. "sealed",
  524. "short",
  525. "sizeof",
  526. "stackalloc",
  527. "static",
  528. "string",
  529. "select",
  530. "this",
  531. "throw",
  532. "true",
  533. "try",
  534. "typeof",
  535. "uint",
  536. "ulong",
  537. "unchecked",
  538. "unsafe",
  539. "ushort",
  540. "using",
  541. "var",
  542. "virtual",
  543. "volatile",
  544. "void",
  545. "when",
  546. "while",
  547. "where",
  548. "yield",
  549. "model",
  550. "inject"
  551. ],
  552. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/
  553. };
  554. return __toCommonJS(razor_exports);
  555. })();
  556. return moduleExports;
  557. });