123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499 |
- "use strict";
- /*!-----------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Version: 0.37.1(20a8d5a651d057aaed7875ad1c1f2ecf13c4e773)
- * Released under the MIT license
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
- *-----------------------------------------------------------------------------*/
- define("vs/basic-languages/php/php", ["require"],(require)=>{
- var moduleExports = (() => {
- var __defProp = Object.defineProperty;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
- };
- var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
- };
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
- // src/basic-languages/php/php.ts
- var php_exports = {};
- __export(php_exports, {
- conf: () => conf,
- language: () => language
- });
- 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})/
- };
- return __toCommonJS(php_exports);
- })();
- return moduleExports;
- });
|