bicep-JHG7GW5Z.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/bicep/bicep.js
  3. var bounded = (text) => `\\b${text}\\b`;
  4. var identifierStart = "[_a-zA-Z]";
  5. var identifierContinue = "[_a-zA-Z0-9]";
  6. var identifier = bounded(`${identifierStart}${identifierContinue}*`);
  7. var keywords = [
  8. "targetScope",
  9. "resource",
  10. "module",
  11. "param",
  12. "var",
  13. "output",
  14. "for",
  15. "in",
  16. "if",
  17. "existing"
  18. ];
  19. var namedLiterals = ["true", "false", "null"];
  20. var nonCommentWs = `[ \\t\\r\\n]`;
  21. var numericLiteral = `[0-9]+`;
  22. var conf = {
  23. comments: {
  24. lineComment: "//",
  25. blockComment: ["/*", "*/"]
  26. },
  27. brackets: [
  28. ["{", "}"],
  29. ["[", "]"],
  30. ["(", ")"]
  31. ],
  32. surroundingPairs: [
  33. { open: "{", close: "}" },
  34. { open: "[", close: "]" },
  35. { open: "(", close: ")" },
  36. { open: "'", close: "'" },
  37. { open: "'''", close: "'''" }
  38. ],
  39. autoClosingPairs: [
  40. { open: "{", close: "}" },
  41. { open: "[", close: "]" },
  42. { open: "(", close: ")" },
  43. { open: "'", close: "'", notIn: ["string", "comment"] },
  44. { open: "'''", close: "'''", notIn: ["string", "comment"] }
  45. ],
  46. autoCloseBefore: ":.,=}])' \n ",
  47. indentationRules: {
  48. increaseIndentPattern: new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),
  49. decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")
  50. }
  51. };
  52. var language = {
  53. defaultToken: "",
  54. tokenPostfix: ".bicep",
  55. brackets: [
  56. { open: "{", close: "}", token: "delimiter.curly" },
  57. { open: "[", close: "]", token: "delimiter.square" },
  58. { open: "(", close: ")", token: "delimiter.parenthesis" }
  59. ],
  60. symbols: /[=><!~?:&|+\-*/^%]+/,
  61. keywords,
  62. namedLiterals,
  63. escapes: `\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\\${)`,
  64. tokenizer: {
  65. root: [{ include: "@expression" }, { include: "@whitespace" }],
  66. stringVerbatim: [
  67. { regex: `(|'|'')[^']`, action: { token: "string" } },
  68. { regex: `'''`, action: { token: "string.quote", next: "@pop" } }
  69. ],
  70. stringLiteral: [
  71. { regex: `\\\${`, action: { token: "delimiter.bracket", next: "@bracketCounting" } },
  72. { regex: `[^\\\\'$]+`, action: { token: "string" } },
  73. { regex: "@escapes", action: { token: "string.escape" } },
  74. { regex: `\\\\.`, action: { token: "string.escape.invalid" } },
  75. { regex: `'`, action: { token: "string", next: "@pop" } }
  76. ],
  77. bracketCounting: [
  78. { regex: `{`, action: { token: "delimiter.bracket", next: "@bracketCounting" } },
  79. { regex: `}`, action: { token: "delimiter.bracket", next: "@pop" } },
  80. { include: "expression" }
  81. ],
  82. comment: [
  83. { regex: `[^\\*]+`, action: { token: "comment" } },
  84. { regex: `\\*\\/`, action: { token: "comment", next: "@pop" } },
  85. { regex: `[\\/*]`, action: { token: "comment" } }
  86. ],
  87. whitespace: [
  88. { regex: nonCommentWs },
  89. { regex: `\\/\\*`, action: { token: "comment", next: "@comment" } },
  90. { regex: `\\/\\/.*$`, action: { token: "comment" } }
  91. ],
  92. expression: [
  93. { regex: `'''`, action: { token: "string.quote", next: "@stringVerbatim" } },
  94. { regex: `'`, action: { token: "string.quote", next: "@stringLiteral" } },
  95. { regex: numericLiteral, action: { token: "number" } },
  96. {
  97. regex: identifier,
  98. action: {
  99. cases: {
  100. "@keywords": { token: "keyword" },
  101. "@namedLiterals": { token: "keyword" },
  102. "@default": { token: "identifier" }
  103. }
  104. }
  105. }
  106. ]
  107. }
  108. };
  109. export {
  110. conf,
  111. language
  112. };
  113. /*! Bundled license information:
  114. monaco-editor/esm/vs/basic-languages/bicep/bicep.js:
  115. (*!-----------------------------------------------------------------------------
  116. * Copyright (c) Microsoft Corporation. All rights reserved.
  117. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  118. * Released under the MIT license
  119. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  120. *-----------------------------------------------------------------------------*)
  121. */
  122. //# sourceMappingURL=bicep-JHG7GW5Z.js.map