123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- /*!-----------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Version: 0.31.1(337587859b1c171314b40503171188b6cea6a32a)
- * Released under the MIT license
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
- *-----------------------------------------------------------------------------*/
- define("vs/basic-languages/less/less",[],()=>{
- var moduleExports = (() => {
- var __defProp = Object.defineProperty;
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
- var __export = (target, all) => {
- __markAsModule(target);
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
- };
- // src/basic-languages/less/less.ts
- var less_exports = {};
- __export(less_exports, {
- conf: () => conf,
- language: () => language
- });
- var conf = {
- wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
- comments: {
- blockComment: ["/*", "*/"],
- lineComment: "//"
- },
- brackets: [
- ["{", "}"],
- ["[", "]"],
- ["(", ")"]
- ],
- autoClosingPairs: [
- { open: "{", close: "}", notIn: ["string", "comment"] },
- { open: "[", close: "]", notIn: ["string", "comment"] },
- { open: "(", close: ")", notIn: ["string", "comment"] },
- { open: '"', close: '"', notIn: ["string", "comment"] },
- { open: "'", close: "'", notIn: ["string", "comment"] }
- ],
- surroundingPairs: [
- { open: "{", close: "}" },
- { open: "[", close: "]" },
- { open: "(", close: ")" },
- { open: '"', close: '"' },
- { open: "'", close: "'" }
- ],
- folding: {
- markers: {
- start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
- end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
- }
- }
- };
- var language = {
- defaultToken: "",
- tokenPostfix: ".less",
- 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])))*",
- 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])))*",
- brackets: [
- { open: "{", close: "}", token: "delimiter.curly" },
- { open: "[", close: "]", token: "delimiter.bracket" },
- { open: "(", close: ")", token: "delimiter.parenthesis" },
- { open: "<", close: ">", token: "delimiter.angle" }
- ],
- tokenizer: {
- root: [
- { include: "@nestedJSBegin" },
- ["[ \\t\\r\\n]+", ""],
- { include: "@comments" },
- { include: "@keyword" },
- { include: "@strings" },
- { include: "@numbers" },
- ["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))", "attribute.name", "@attribute"],
- ["url(\\-prefix)?\\(", { token: "tag", next: "@urldeclaration" }],
- ["[{}()\\[\\]]", "@brackets"],
- ["[,:;]", "delimiter"],
- ["#@identifierPlus", "tag.id"],
- ["&", "tag"],
- ["\\.@identifierPlus(?=\\()", "tag.class", "@attribute"],
- ["\\.@identifierPlus", "tag.class"],
- ["@identifierPlus", "tag"],
- { include: "@operators" },
- ["@(@identifier(?=[:,\\)]))", "variable", "@attribute"],
- ["@(@identifier)", "variable"],
- ["@", "key", "@atRules"]
- ],
- nestedJSBegin: [
- ["``", "delimiter.backtick"],
- [
- "`",
- {
- token: "delimiter.backtick",
- next: "@nestedJSEnd",
- nextEmbedded: "text/javascript"
- }
- ]
- ],
- nestedJSEnd: [
- [
- "`",
- {
- token: "delimiter.backtick",
- next: "@pop",
- nextEmbedded: "@pop"
- }
- ]
- ],
- operators: [["[<>=\\+\\-\\*\\/\\^\\|\\~]", "operator"]],
- keyword: [
- [
- "(@[\\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",
- "keyword"
- ]
- ],
- urldeclaration: [
- { include: "@strings" },
- ["[^)\r\n]+", "string"],
- ["\\)", { token: "tag", next: "@pop" }]
- ],
- attribute: [
- { include: "@nestedJSBegin" },
- { include: "@comments" },
- { include: "@strings" },
- { include: "@numbers" },
- { include: "@keyword" },
- ["[a-zA-Z\\-]+(?=\\()", "attribute.value", "@attribute"],
- [">", "operator", "@pop"],
- ["@identifier", "attribute.value"],
- { include: "@operators" },
- ["@(@identifier)", "variable"],
- ["[)\\}]", "@brackets", "@pop"],
- ["[{}()\\[\\]>]", "@brackets"],
- ["[;]", "delimiter", "@pop"],
- ["[,=:]", "delimiter"],
- ["\\s", ""],
- [".", "attribute.value"]
- ],
- comments: [
- ["\\/\\*", "comment", "@comment"],
- ["\\/\\/+.*", "comment"]
- ],
- comment: [
- ["\\*\\/", "comment", "@pop"],
- [".", "comment"]
- ],
- numbers: [
- ["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }],
- ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]
- ],
- units: [
- [
- "(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
- "attribute.value.unit",
- "@pop"
- ]
- ],
- strings: [
- ['~?"', { token: "string.delimiter", next: "@stringsEndDoubleQuote" }],
- ["~?'", { token: "string.delimiter", next: "@stringsEndQuote" }]
- ],
- stringsEndDoubleQuote: [
- ['\\\\"', "string"],
- ['"', { token: "string.delimiter", next: "@popall" }],
- [".", "string"]
- ],
- stringsEndQuote: [
- ["\\\\'", "string"],
- ["'", { token: "string.delimiter", next: "@popall" }],
- [".", "string"]
- ],
- atRules: [
- { include: "@comments" },
- { include: "@strings" },
- ["[()]", "delimiter"],
- ["[\\{;]", "delimiter", "@pop"],
- [".", "key"]
- ]
- }
- };
- return less_exports;
- })();
- return moduleExports;
- });
|