yanzi-monaco-editorbb
Version:
这是一个基于微软的monaco和vue封装的一个代码编辑器,浏览器可运行。主要功能有:html、javascript、css代码编辑,高亮显示,语法错误提示等,可以帮您的项目很快的拥有一个web端的代码编辑器
266 lines (255 loc) • 12.4 kB
JavaScript
((typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] || []).push([[46],{
/***/ "9571":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; });
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4d63");
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("c607");
/* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ac1f");
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("2c3e");
/* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("25f0");
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__);
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.32.1(29a273516805a852aa8edc5e05059f119b13eff0)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
// src/basic-languages/php/php.ts
var conf = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: {
lineComment: "//",
blockComment: ["/*", "*/"]
},
brackets: [["{", "}"], ["[", "]"], ["(", ")"]],
autoClosingPairs: [{
open: "{",
close: "}",
notIn: ["string"]
}, {
open: "[",
close: "]",
notIn: ["string"]
}, {
open: "(",
close: ")",
notIn: ["string"]
}, {
open: '"',
close: '"',
notIn: ["string"]
}, {
open: "'",
close: "'",
notIn: ["string", "comment"]
}],
folding: {
markers: {
start: new RegExp("^\\s*(#|//)region\\b"),
end: new RegExp("^\\s*(#|//)endregion\\b")
}
}
};
var language = {
defaultToken: "",
tokenPostfix: "",
tokenizer: {
root: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.root"
}], [/<!DOCTYPE/, "metatag.html", "@doctype"], [/<!--/, "comment.html", "@comment"], [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]], [/(<)(script)/, ["delimiter.html", {
token: "tag.html",
next: "@script"
}]], [/(<)(style)/, ["delimiter.html", {
token: "tag.html",
next: "@style"
}]], [/(<)([:\w]+)/, ["delimiter.html", {
token: "tag.html",
next: "@otherTag"
}]], [/(<\/)(\w+)/, ["delimiter.html", {
token: "tag.html",
next: "@otherTag"
}]], [/</, "delimiter.html"], [/[^<]+/]],
doctype: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.comment"
}], [/[^>]+/, "metatag.content.html"], [/>/, "metatag.html", "@pop"]],
comment: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.comment"
}], [/-->/, "comment.html", "@pop"], [/[^-]+/, "comment.content.html"], [/./, "comment.content.html"]],
otherTag: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.otherTag"
}], [/\/?>/, "delimiter.html", "@pop"], [/"([^"]*)"/, "attribute.value"], [/'([^']*)'/, "attribute.value"], [/[\w\-]+/, "attribute.name"], [/=/, "delimiter"], [/[ \t\r\n]+/]],
script: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.script"
}], [/type/, "attribute.name", "@scriptAfterType"], [/"([^"]*)"/, "attribute.value"], [/'([^']*)'/, "attribute.value"], [/[\w\-]+/, "attribute.name"], [/=/, "delimiter"], [/>/, {
token: "delimiter.html",
next: "@scriptEmbedded.text/javascript",
nextEmbedded: "text/javascript"
}], [/[ \t\r\n]+/], [/(<\/)(script\s*)(>)/, ["delimiter.html", "tag.html", {
token: "delimiter.html",
next: "@pop"
}]]],
scriptAfterType: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.scriptAfterType"
}], [/=/, "delimiter", "@scriptAfterTypeEquals"], [/>/, {
token: "delimiter.html",
next: "@scriptEmbedded.text/javascript",
nextEmbedded: "text/javascript"
}], [/[ \t\r\n]+/], [/<\/script\s*>/, {
token: "@rematch",
next: "@pop"
}]],
scriptAfterTypeEquals: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.scriptAfterTypeEquals"
}], [/"([^"]*)"/, {
token: "attribute.value",
switchTo: "@scriptWithCustomType.$1"
}], [/'([^']*)'/, {
token: "attribute.value",
switchTo: "@scriptWithCustomType.$1"
}], [/>/, {
token: "delimiter.html",
next: "@scriptEmbedded.text/javascript",
nextEmbedded: "text/javascript"
}], [/[ \t\r\n]+/], [/<\/script\s*>/, {
token: "@rematch",
next: "@pop"
}]],
scriptWithCustomType: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.scriptWithCustomType.$S2"
}], [/>/, {
token: "delimiter.html",
next: "@scriptEmbedded.$S2",
nextEmbedded: "$S2"
}], [/"([^"]*)"/, "attribute.value"], [/'([^']*)'/, "attribute.value"], [/[\w\-]+/, "attribute.name"], [/=/, "delimiter"], [/[ \t\r\n]+/], [/<\/script\s*>/, {
token: "@rematch",
next: "@pop"
}]],
scriptEmbedded: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInEmbeddedState.scriptEmbedded.$S2",
nextEmbedded: "@pop"
}], [/<\/script/, {
token: "@rematch",
next: "@pop",
nextEmbedded: "@pop"
}]],
style: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.style"
}], [/type/, "attribute.name", "@styleAfterType"], [/"([^"]*)"/, "attribute.value"], [/'([^']*)'/, "attribute.value"], [/[\w\-]+/, "attribute.name"], [/=/, "delimiter"], [/>/, {
token: "delimiter.html",
next: "@styleEmbedded.text/css",
nextEmbedded: "text/css"
}], [/[ \t\r\n]+/], [/(<\/)(style\s*)(>)/, ["delimiter.html", "tag.html", {
token: "delimiter.html",
next: "@pop"
}]]],
styleAfterType: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.styleAfterType"
}], [/=/, "delimiter", "@styleAfterTypeEquals"], [/>/, {
token: "delimiter.html",
next: "@styleEmbedded.text/css",
nextEmbedded: "text/css"
}], [/[ \t\r\n]+/], [/<\/style\s*>/, {
token: "@rematch",
next: "@pop"
}]],
styleAfterTypeEquals: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.styleAfterTypeEquals"
}], [/"([^"]*)"/, {
token: "attribute.value",
switchTo: "@styleWithCustomType.$1"
}], [/'([^']*)'/, {
token: "attribute.value",
switchTo: "@styleWithCustomType.$1"
}], [/>/, {
token: "delimiter.html",
next: "@styleEmbedded.text/css",
nextEmbedded: "text/css"
}], [/[ \t\r\n]+/], [/<\/style\s*>/, {
token: "@rematch",
next: "@pop"
}]],
styleWithCustomType: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInSimpleState.styleWithCustomType.$S2"
}], [/>/, {
token: "delimiter.html",
next: "@styleEmbedded.$S2",
nextEmbedded: "$S2"
}], [/"([^"]*)"/, "attribute.value"], [/'([^']*)'/, "attribute.value"], [/[\w\-]+/, "attribute.name"], [/=/, "delimiter"], [/[ \t\r\n]+/], [/<\/style\s*>/, {
token: "@rematch",
next: "@pop"
}]],
styleEmbedded: [[/<\?((php)|=)?/, {
token: "@rematch",
switchTo: "@phpInEmbeddedState.styleEmbedded.$S2",
nextEmbedded: "@pop"
}], [/<\/style/, {
token: "@rematch",
next: "@pop",
nextEmbedded: "@pop"
}]],
phpInSimpleState: [[/<\?((php)|=)?/, "metatag.php"], [/\?>/, {
token: "metatag.php",
switchTo: "@$S2.$S3"
}], {
include: "phpRoot"
}],
phpInEmbeddedState: [[/<\?((php)|=)?/, "metatag.php"], [/\?>/, {
token: "metatag.php",
switchTo: "@$S2.$S3",
nextEmbedded: "$S3"
}], {
include: "phpRoot"
}],
phpRoot: [[/[a-zA-Z_]\w*/, {
cases: {
"@phpKeywords": {
token: "keyword.php"
},
"@phpCompileTimeConstants": {
token: "constant.php"
},
"@default": "identifier.php"
}
}], [/[$a-zA-Z_]\w*/, {
cases: {
"@phpPreDefinedVariables": {
token: "variable.predefined.php"
},
"@default": "variable.php"
}
}], [/[{}]/, "delimiter.bracket.php"], [/[\[\]]/, "delimiter.array.php"], [/[()]/, "delimiter.parenthesis.php"], [/[ \t\r\n]+/], [/(#|\/\/)$/, "comment.php"], [/(#|\/\/)/, "comment.php", "@phpLineComment"], [/\/\*/, "comment.php", "@phpComment"], [/"/, "string.php", "@phpDoubleQuoteString"], [/'/, "string.php", "@phpSingleQuoteString"], [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/, "delimiter.php"], [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.php"], [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.php"], [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.php"], [/0[0-7']*[0-7]/, "number.octal.php"], [/0[bB][0-1']*[0-1]/, "number.binary.php"], [/\d[\d']*/, "number.php"], [/\d/, "number.php"]],
phpComment: [[/\*\//, "comment.php", "@pop"], [/[^*]+/, "comment.php"], [/./, "comment.php"]],
phpLineComment: [[/\?>/, {
token: "@rematch",
next: "@pop"
}], [/.$/, "comment.php", "@pop"], [/[^?]+$/, "comment.php", "@pop"], [/[^?]+/, "comment.php"], [/./, "comment.php"]],
phpDoubleQuoteString: [[/[^\\"]+/, "string.php"], [/@escapes/, "string.escape.php"], [/\\./, "string.escape.invalid.php"], [/"/, "string.php", "@pop"]],
phpSingleQuoteString: [[/[^\\']+/, "string.php"], [/@escapes/, "string.escape.php"], [/\\./, "string.escape.invalid.php"], [/'/, "string.php", "@pop"]]
},
phpKeywords: ["abstract", "and", "array", "as", "break", "callable", "case", "catch", "cfunction", "class", "clone", "const", "continue", "declare", "default", "do", "else", "elseif", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "extends", "false", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "interface", "instanceof", "insteadof", "namespace", "new", "null", "object", "old_function", "or", "private", "protected", "public", "resource", "static", "switch", "throw", "trait", "try", "true", "use", "var", "while", "xor", "die", "echo", "empty", "exit", "eval", "include", "include_once", "isset", "list", "require", "require_once", "return", "print", "unset", "yield", "__construct"],
phpCompileTimeConstants: ["__CLASS__", "__DIR__", "__FILE__", "__LINE__", "__NAMESPACE__", "__METHOD__", "__FUNCTION__", "__TRAIT__"],
phpPreDefinedVariables: ["$GLOBALS", "$_SERVER", "$_GET", "$_POST", "$_FILES", "$_REQUEST", "$_SESSION", "$_ENV", "$_COOKIE", "$php_errormsg", "$HTTP_RAW_POST_DATA", "$http_response_header", "$argc", "$argv"],
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/
};
/***/ })
}]);