dockerfile.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. "use strict";
  2. /*!-----------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  5. * Released under the MIT license
  6. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  7. *-----------------------------------------------------------------------------*/
  8. define("vs/basic-languages/dockerfile/dockerfile", ["require"],(require)=>{
  9. var moduleExports = (() => {
  10. var __defProp = Object.defineProperty;
  11. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  12. var __getOwnPropNames = Object.getOwnPropertyNames;
  13. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14. var __export = (target, all) => {
  15. for (var name in all)
  16. __defProp(target, name, { get: all[name], enumerable: true });
  17. };
  18. var __copyProps = (to, from, except, desc) => {
  19. if (from && typeof from === "object" || typeof from === "function") {
  20. for (let key of __getOwnPropNames(from))
  21. if (!__hasOwnProp.call(to, key) && key !== except)
  22. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  23. }
  24. return to;
  25. };
  26. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  27. // src/basic-languages/dockerfile/dockerfile.ts
  28. var dockerfile_exports = {};
  29. __export(dockerfile_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. brackets: [
  35. ["{", "}"],
  36. ["[", "]"],
  37. ["(", ")"]
  38. ],
  39. autoClosingPairs: [
  40. { open: "{", close: "}" },
  41. { open: "[", close: "]" },
  42. { open: "(", close: ")" },
  43. { open: '"', close: '"' },
  44. { open: "'", close: "'" }
  45. ],
  46. surroundingPairs: [
  47. { open: "{", close: "}" },
  48. { open: "[", close: "]" },
  49. { open: "(", close: ")" },
  50. { open: '"', close: '"' },
  51. { open: "'", close: "'" }
  52. ]
  53. };
  54. var language = {
  55. defaultToken: "",
  56. tokenPostfix: ".dockerfile",
  57. variable: /\${?[\w]+}?/,
  58. tokenizer: {
  59. root: [
  60. { include: "@whitespace" },
  61. { include: "@comment" },
  62. [/(ONBUILD)(\s+)/, ["keyword", ""]],
  63. [/(ENV)(\s+)([\w]+)/, ["keyword", "", { token: "variable", next: "@arguments" }]],
  64. [
  65. /(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,
  66. { token: "keyword", next: "@arguments" }
  67. ]
  68. ],
  69. arguments: [
  70. { include: "@whitespace" },
  71. { include: "@strings" },
  72. [
  73. /(@variable)/,
  74. {
  75. cases: {
  76. "@eos": { token: "variable", next: "@popall" },
  77. "@default": "variable"
  78. }
  79. }
  80. ],
  81. [
  82. /\\/,
  83. {
  84. cases: {
  85. "@eos": "",
  86. "@default": ""
  87. }
  88. }
  89. ],
  90. [
  91. /./,
  92. {
  93. cases: {
  94. "@eos": { token: "", next: "@popall" },
  95. "@default": ""
  96. }
  97. }
  98. ]
  99. ],
  100. whitespace: [
  101. [
  102. /\s+/,
  103. {
  104. cases: {
  105. "@eos": { token: "", next: "@popall" },
  106. "@default": ""
  107. }
  108. }
  109. ]
  110. ],
  111. comment: [[/(^#.*$)/, "comment", "@popall"]],
  112. strings: [
  113. [/\\'$/, "", "@popall"],
  114. [/\\'/, ""],
  115. [/'$/, "string", "@popall"],
  116. [/'/, "string", "@stringBody"],
  117. [/"$/, "string", "@popall"],
  118. [/"/, "string", "@dblStringBody"]
  119. ],
  120. stringBody: [
  121. [
  122. /[^\\\$']/,
  123. {
  124. cases: {
  125. "@eos": { token: "string", next: "@popall" },
  126. "@default": "string"
  127. }
  128. }
  129. ],
  130. [/\\./, "string.escape"],
  131. [/'$/, "string", "@popall"],
  132. [/'/, "string", "@pop"],
  133. [/(@variable)/, "variable"],
  134. [/\\$/, "string"],
  135. [/$/, "string", "@popall"]
  136. ],
  137. dblStringBody: [
  138. [
  139. /[^\\\$"]/,
  140. {
  141. cases: {
  142. "@eos": { token: "string", next: "@popall" },
  143. "@default": "string"
  144. }
  145. }
  146. ],
  147. [/\\./, "string.escape"],
  148. [/"$/, "string", "@popall"],
  149. [/"/, "string", "@pop"],
  150. [/(@variable)/, "variable"],
  151. [/\\$/, "string"],
  152. [/$/, "string", "@popall"]
  153. ]
  154. }
  155. };
  156. return __toCommonJS(dockerfile_exports);
  157. })();
  158. return moduleExports;
  159. });