less-GR653M3R.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/less/less.js
  3. var conf = {
  4. wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
  5. comments: {
  6. blockComment: ["/*", "*/"],
  7. lineComment: "//"
  8. },
  9. brackets: [
  10. ["{", "}"],
  11. ["[", "]"],
  12. ["(", ")"]
  13. ],
  14. autoClosingPairs: [
  15. { open: "{", close: "}", notIn: ["string", "comment"] },
  16. { open: "[", close: "]", notIn: ["string", "comment"] },
  17. { open: "(", close: ")", notIn: ["string", "comment"] },
  18. { open: '"', close: '"', notIn: ["string", "comment"] },
  19. { open: "'", close: "'", notIn: ["string", "comment"] }
  20. ],
  21. surroundingPairs: [
  22. { open: "{", close: "}" },
  23. { open: "[", close: "]" },
  24. { open: "(", close: ")" },
  25. { open: '"', close: '"' },
  26. { open: "'", close: "'" }
  27. ],
  28. folding: {
  29. markers: {
  30. start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
  31. end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
  32. }
  33. }
  34. };
  35. var language = {
  36. defaultToken: "",
  37. tokenPostfix: ".less",
  38. 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])))*",
  39. 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])))*",
  40. brackets: [
  41. { open: "{", close: "}", token: "delimiter.curly" },
  42. { open: "[", close: "]", token: "delimiter.bracket" },
  43. { open: "(", close: ")", token: "delimiter.parenthesis" },
  44. { open: "<", close: ">", token: "delimiter.angle" }
  45. ],
  46. tokenizer: {
  47. root: [
  48. { include: "@nestedJSBegin" },
  49. ["[ \\t\\r\\n]+", ""],
  50. { include: "@comments" },
  51. { include: "@keyword" },
  52. { include: "@strings" },
  53. { include: "@numbers" },
  54. ["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))", "attribute.name", "@attribute"],
  55. ["url(\\-prefix)?\\(", { token: "tag", next: "@urldeclaration" }],
  56. ["[{}()\\[\\]]", "@brackets"],
  57. ["[,:;]", "delimiter"],
  58. ["#@identifierPlus", "tag.id"],
  59. ["&", "tag"],
  60. ["\\.@identifierPlus(?=\\()", "tag.class", "@attribute"],
  61. ["\\.@identifierPlus", "tag.class"],
  62. ["@identifierPlus", "tag"],
  63. { include: "@operators" },
  64. ["@(@identifier(?=[:,\\)]))", "variable", "@attribute"],
  65. ["@(@identifier)", "variable"],
  66. ["@", "key", "@atRules"]
  67. ],
  68. nestedJSBegin: [
  69. ["``", "delimiter.backtick"],
  70. [
  71. "`",
  72. {
  73. token: "delimiter.backtick",
  74. next: "@nestedJSEnd",
  75. nextEmbedded: "text/javascript"
  76. }
  77. ]
  78. ],
  79. nestedJSEnd: [
  80. [
  81. "`",
  82. {
  83. token: "delimiter.backtick",
  84. next: "@pop",
  85. nextEmbedded: "@pop"
  86. }
  87. ]
  88. ],
  89. operators: [["[<>=\\+\\-\\*\\/\\^\\|\\~]", "operator"]],
  90. keyword: [
  91. [
  92. "(@[\\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",
  93. "keyword"
  94. ]
  95. ],
  96. urldeclaration: [
  97. { include: "@strings" },
  98. ["[^)\r\n]+", "string"],
  99. ["\\)", { token: "tag", next: "@pop" }]
  100. ],
  101. attribute: [
  102. { include: "@nestedJSBegin" },
  103. { include: "@comments" },
  104. { include: "@strings" },
  105. { include: "@numbers" },
  106. { include: "@keyword" },
  107. ["[a-zA-Z\\-]+(?=\\()", "attribute.value", "@attribute"],
  108. [">", "operator", "@pop"],
  109. ["@identifier", "attribute.value"],
  110. { include: "@operators" },
  111. ["@(@identifier)", "variable"],
  112. ["[)\\}]", "@brackets", "@pop"],
  113. ["[{}()\\[\\]>]", "@brackets"],
  114. ["[;]", "delimiter", "@pop"],
  115. ["[,=:]", "delimiter"],
  116. ["\\s", ""],
  117. [".", "attribute.value"]
  118. ],
  119. comments: [
  120. ["\\/\\*", "comment", "@comment"],
  121. ["\\/\\/+.*", "comment"]
  122. ],
  123. comment: [
  124. ["\\*\\/", "comment", "@pop"],
  125. [".", "comment"]
  126. ],
  127. numbers: [
  128. ["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }],
  129. ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]
  130. ],
  131. units: [
  132. [
  133. "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
  134. "attribute.value.unit",
  135. "@pop"
  136. ]
  137. ],
  138. strings: [
  139. ['~?"', { token: "string.delimiter", next: "@stringsEndDoubleQuote" }],
  140. ["~?'", { token: "string.delimiter", next: "@stringsEndQuote" }]
  141. ],
  142. stringsEndDoubleQuote: [
  143. ['\\\\"', "string"],
  144. ['"', { token: "string.delimiter", next: "@popall" }],
  145. [".", "string"]
  146. ],
  147. stringsEndQuote: [
  148. ["\\\\'", "string"],
  149. ["'", { token: "string.delimiter", next: "@popall" }],
  150. [".", "string"]
  151. ],
  152. atRules: [
  153. { include: "@comments" },
  154. { include: "@strings" },
  155. ["[()]", "delimiter"],
  156. ["[\\{;]", "delimiter", "@pop"],
  157. [".", "key"]
  158. ]
  159. }
  160. };
  161. export {
  162. conf,
  163. language
  164. };
  165. /*! Bundled license information:
  166. monaco-editor/esm/vs/basic-languages/less/less.js:
  167. (*!-----------------------------------------------------------------------------
  168. * Copyright (c) Microsoft Corporation. All rights reserved.
  169. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  170. * Released under the MIT license
  171. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  172. *-----------------------------------------------------------------------------*)
  173. */
  174. //# sourceMappingURL=less-GR653M3R.js.map