hcl-HJRTIZIE.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.js
  3. var conf = {
  4. comments: {
  5. lineComment: "#",
  6. blockComment: ["/*", "*/"]
  7. },
  8. brackets: [
  9. ["{", "}"],
  10. ["[", "]"],
  11. ["(", ")"]
  12. ],
  13. autoClosingPairs: [
  14. { open: "{", close: "}" },
  15. { open: "[", close: "]" },
  16. { open: "(", close: ")" },
  17. { open: '"', close: '"', notIn: ["string"] }
  18. ],
  19. surroundingPairs: [
  20. { open: "{", close: "}" },
  21. { open: "[", close: "]" },
  22. { open: "(", close: ")" },
  23. { open: '"', close: '"' }
  24. ]
  25. };
  26. var language = {
  27. defaultToken: "",
  28. tokenPostfix: ".hcl",
  29. keywords: [
  30. "var",
  31. "local",
  32. "path",
  33. "for_each",
  34. "any",
  35. "string",
  36. "number",
  37. "bool",
  38. "true",
  39. "false",
  40. "null",
  41. "if ",
  42. "else ",
  43. "endif ",
  44. "for ",
  45. "in",
  46. "endfor"
  47. ],
  48. operators: [
  49. "=",
  50. ">=",
  51. "<=",
  52. "==",
  53. "!=",
  54. "+",
  55. "-",
  56. "*",
  57. "/",
  58. "%",
  59. "&&",
  60. "||",
  61. "!",
  62. "<",
  63. ">",
  64. "?",
  65. "...",
  66. ":"
  67. ],
  68. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  69. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  70. terraformFunctions: /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
  71. terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
  72. tokenizer: {
  73. root: [
  74. [
  75. /^@terraformMainBlocks([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
  76. ["type", "", "string", "", "string", "", "@brackets"]
  77. ],
  78. [
  79. /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
  80. ["identifier", "", "string", "", "string", "", "@brackets"]
  81. ],
  82. [
  83. /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)(=)(\{)/,
  84. ["identifier", "", "string", "", "operator", "", "@brackets"]
  85. ],
  86. { include: "@terraform" }
  87. ],
  88. terraform: [
  89. [/@terraformFunctions(\()/, ["type", "@brackets"]],
  90. [
  91. /[a-zA-Z_]\w*-*/,
  92. {
  93. cases: {
  94. "@keywords": { token: "keyword.$0" },
  95. "@default": "variable"
  96. }
  97. }
  98. ],
  99. { include: "@whitespace" },
  100. { include: "@heredoc" },
  101. [/[{}()\[\]]/, "@brackets"],
  102. [/[<>](?!@symbols)/, "@brackets"],
  103. [
  104. /@symbols/,
  105. {
  106. cases: {
  107. "@operators": "operator",
  108. "@default": ""
  109. }
  110. }
  111. ],
  112. [/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
  113. [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
  114. [/\d[\d']*/, "number"],
  115. [/\d/, "number"],
  116. [/[;,.]/, "delimiter"],
  117. [/"/, "string", "@string"],
  118. [/'/, "invalid"]
  119. ],
  120. heredoc: [
  121. [/<<[-]*\s*["]?([\w\-]+)["]?/, { token: "string.heredoc.delimiter", next: "@heredocBody.$1" }]
  122. ],
  123. heredocBody: [
  124. [
  125. /([\w\-]+)$/,
  126. {
  127. cases: {
  128. "$1==$S2": [
  129. {
  130. token: "string.heredoc.delimiter",
  131. next: "@popall"
  132. }
  133. ],
  134. "@default": "string.heredoc"
  135. }
  136. }
  137. ],
  138. [/./, "string.heredoc"]
  139. ],
  140. whitespace: [
  141. [/[ \t\r\n]+/, ""],
  142. [/\/\*/, "comment", "@comment"],
  143. [/\/\/.*$/, "comment"],
  144. [/#.*$/, "comment"]
  145. ],
  146. comment: [
  147. [/[^\/*]+/, "comment"],
  148. [/\*\//, "comment", "@pop"],
  149. [/[\/*]/, "comment"]
  150. ],
  151. string: [
  152. [/\$\{/, { token: "delimiter", next: "@stringExpression" }],
  153. [/[^\\"\$]+/, "string"],
  154. [/@escapes/, "string.escape"],
  155. [/\\./, "string.escape.invalid"],
  156. [/"/, "string", "@popall"]
  157. ],
  158. stringInsideExpression: [
  159. [/[^\\"]+/, "string"],
  160. [/@escapes/, "string.escape"],
  161. [/\\./, "string.escape.invalid"],
  162. [/"/, "string", "@pop"]
  163. ],
  164. stringExpression: [
  165. [/\}/, { token: "delimiter", next: "@pop" }],
  166. [/"/, "string", "@stringInsideExpression"],
  167. { include: "@terraform" }
  168. ]
  169. }
  170. };
  171. export {
  172. conf,
  173. language
  174. };
  175. /*! Bundled license information:
  176. monaco-editor/esm/vs/basic-languages/hcl/hcl.js:
  177. (*!-----------------------------------------------------------------------------
  178. * Copyright (c) Microsoft Corporation. All rights reserved.
  179. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  180. * Released under the MIT license
  181. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  182. *-----------------------------------------------------------------------------*)
  183. */
  184. //# sourceMappingURL=hcl-HJRTIZIE.js.map