b0368a59a07bc45c2e118f0a3bf0889daea590312bc8f5d6214a91b825d3847fff3cc5c13ad5bfa55ab42d0ffbdfe7e7e6424fc512a8cd8434fa368445a773 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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/less/less", ["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/less/less.ts
  28. var less_exports = {};
  29. __export(less_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
  35. comments: {
  36. blockComment: ["/*", "*/"],
  37. lineComment: "//"
  38. },
  39. brackets: [
  40. ["{", "}"],
  41. ["[", "]"],
  42. ["(", ")"]
  43. ],
  44. autoClosingPairs: [
  45. { open: "{", close: "}", notIn: ["string", "comment"] },
  46. { open: "[", close: "]", notIn: ["string", "comment"] },
  47. { open: "(", close: ")", notIn: ["string", "comment"] },
  48. { open: '"', close: '"', notIn: ["string", "comment"] },
  49. { open: "'", close: "'", notIn: ["string", "comment"] }
  50. ],
  51. surroundingPairs: [
  52. { open: "{", close: "}" },
  53. { open: "[", close: "]" },
  54. { open: "(", close: ")" },
  55. { open: '"', close: '"' },
  56. { open: "'", close: "'" }
  57. ],
  58. folding: {
  59. markers: {
  60. start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
  61. end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
  62. }
  63. }
  64. };
  65. var language = {
  66. defaultToken: "",
  67. tokenPostfix: ".less",
  68. identifier: "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
  69. identifierPlus: "-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
  70. brackets: [
  71. { open: "{", close: "}", token: "delimiter.curly" },
  72. { open: "[", close: "]", token: "delimiter.bracket" },
  73. { open: "(", close: ")", token: "delimiter.parenthesis" },
  74. { open: "<", close: ">", token: "delimiter.angle" }
  75. ],
  76. tokenizer: {
  77. root: [
  78. { include: "@nestedJSBegin" },
  79. ["[ \\t\\r\\n]+", ""],
  80. { include: "@comments" },
  81. { include: "@keyword" },
  82. { include: "@strings" },
  83. { include: "@numbers" },
  84. ["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))", "attribute.name", "@attribute"],
  85. ["url(\\-prefix)?\\(", { token: "tag", next: "@urldeclaration" }],
  86. ["[{}()\\[\\]]", "@brackets"],
  87. ["[,:;]", "delimiter"],
  88. ["#@identifierPlus", "tag.id"],
  89. ["&", "tag"],
  90. ["\\.@identifierPlus(?=\\()", "tag.class", "@attribute"],
  91. ["\\.@identifierPlus", "tag.class"],
  92. ["@identifierPlus", "tag"],
  93. { include: "@operators" },
  94. ["@(@identifier(?=[:,\\)]))", "variable", "@attribute"],
  95. ["@(@identifier)", "variable"],
  96. ["@", "key", "@atRules"]
  97. ],
  98. nestedJSBegin: [
  99. ["``", "delimiter.backtick"],
  100. [
  101. "`",
  102. {
  103. token: "delimiter.backtick",
  104. next: "@nestedJSEnd",
  105. nextEmbedded: "text/javascript"
  106. }
  107. ]
  108. ],
  109. nestedJSEnd: [
  110. [
  111. "`",
  112. {
  113. token: "delimiter.backtick",
  114. next: "@pop",
  115. nextEmbedded: "@pop"
  116. }
  117. ]
  118. ],
  119. operators: [["[<>=\\+\\-\\*\\/\\^\\|\\~]", "operator"]],
  120. keyword: [
  121. [
  122. "(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b",
  123. "keyword"
  124. ]
  125. ],
  126. urldeclaration: [
  127. { include: "@strings" },
  128. ["[^)\r\n]+", "string"],
  129. ["\\)", { token: "tag", next: "@pop" }]
  130. ],
  131. attribute: [
  132. { include: "@nestedJSBegin" },
  133. { include: "@comments" },
  134. { include: "@strings" },
  135. { include: "@numbers" },
  136. { include: "@keyword" },
  137. ["[a-zA-Z\\-]+(?=\\()", "attribute.value", "@attribute"],
  138. [">", "operator", "@pop"],
  139. ["@identifier", "attribute.value"],
  140. { include: "@operators" },
  141. ["@(@identifier)", "variable"],
  142. ["[)\\}]", "@brackets", "@pop"],
  143. ["[{}()\\[\\]>]", "@brackets"],
  144. ["[;]", "delimiter", "@pop"],
  145. ["[,=:]", "delimiter"],
  146. ["\\s", ""],
  147. [".", "attribute.value"]
  148. ],
  149. comments: [
  150. ["\\/\\*", "comment", "@comment"],
  151. ["\\/\\/+.*", "comment"]
  152. ],
  153. comment: [
  154. ["\\*\\/", "comment", "@pop"],
  155. [".", "comment"]
  156. ],
  157. numbers: [
  158. ["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }],
  159. ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]
  160. ],
  161. units: [
  162. [
  163. "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
  164. "attribute.value.unit",
  165. "@pop"
  166. ]
  167. ],
  168. strings: [
  169. ['~?"', { token: "string.delimiter", next: "@stringsEndDoubleQuote" }],
  170. ["~?'", { token: "string.delimiter", next: "@stringsEndQuote" }]
  171. ],
  172. stringsEndDoubleQuote: [
  173. ['\\\\"', "string"],
  174. ['"', { token: "string.delimiter", next: "@popall" }],
  175. [".", "string"]
  176. ],
  177. stringsEndQuote: [
  178. ["\\\\'", "string"],
  179. ["'", { token: "string.delimiter", next: "@popall" }],
  180. [".", "string"]
  181. ],
  182. atRules: [
  183. { include: "@comments" },
  184. { include: "@strings" },
  185. ["[()]", "delimiter"],
  186. ["[\\{;]", "delimiter", "@pop"],
  187. [".", "key"]
  188. ]
  189. }
  190. };
  191. return __toCommonJS(less_exports);
  192. })();
  193. return moduleExports;
  194. });