306 lines
11 KiB
JavaScript
306 lines
11 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 939e07c76f4b30f0.294c1bf0d6.js
|
|
* Module id: 463753
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e, t, i) => {
|
|
"use strict";
|
|
var r = e.r(916033);
|
|
function a(e) {
|
|
var t, i, a, n, A, s, o;
|
|
e.register(r),
|
|
(t = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/),
|
|
(i = [
|
|
{ pattern: /\b(?:false|true)\b/i, alias: "boolean" },
|
|
{
|
|
pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
/\b(?:null)\b/i,
|
|
/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,
|
|
]),
|
|
(a =
|
|
/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i),
|
|
(n =
|
|
/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/),
|
|
(A = /[{}\[\](),:;]/),
|
|
(e.languages.php = {
|
|
delimiter: {
|
|
pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
|
|
alias: "important",
|
|
},
|
|
comment: t,
|
|
variable: /\$+(?:\w+\b|(?=\{))/,
|
|
package: {
|
|
pattern:
|
|
/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
"class-name-definition": {
|
|
pattern:
|
|
/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
|
|
lookbehind: !0,
|
|
alias: "class-name",
|
|
},
|
|
"function-definition": {
|
|
pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
|
|
lookbehind: !0,
|
|
alias: "function",
|
|
},
|
|
keyword: [
|
|
{
|
|
pattern:
|
|
/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
|
|
alias: "type-casting",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern:
|
|
/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
|
|
alias: "type-hint",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern:
|
|
/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string|void)\b/i,
|
|
alias: "return-type",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern:
|
|
/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
|
|
alias: "type-declaration",
|
|
greedy: !0,
|
|
},
|
|
{
|
|
pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
|
|
alias: "type-declaration",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /\b(?:parent|self|static)(?=\s*::)/i,
|
|
alias: "static-context",
|
|
greedy: !0,
|
|
},
|
|
{ pattern: /(\byield\s+)from\b/i, lookbehind: !0 },
|
|
/\bclass\b/i,
|
|
{
|
|
pattern:
|
|
/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
|
|
lookbehind: !0,
|
|
},
|
|
],
|
|
"argument-name": {
|
|
pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,
|
|
lookbehind: !0,
|
|
},
|
|
"class-name": [
|
|
{
|
|
pattern:
|
|
/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{ pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i, greedy: !0 },
|
|
{
|
|
pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
|
|
alias: "class-name-fully-qualified",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
|
|
alias: "class-name-fully-qualified",
|
|
greedy: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern:
|
|
/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
alias: "class-name-fully-qualified",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern: /\b[a-z_]\w*(?=\s*\$)/i,
|
|
alias: "type-declaration",
|
|
greedy: !0,
|
|
},
|
|
{
|
|
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
|
alias: ["class-name-fully-qualified", "type-declaration"],
|
|
greedy: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern: /\b[a-z_]\w*(?=\s*::)/i,
|
|
alias: "static-context",
|
|
greedy: !0,
|
|
},
|
|
{
|
|
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
|
|
alias: ["class-name-fully-qualified", "static-context"],
|
|
greedy: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
|
|
alias: "type-hint",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
|
alias: ["class-name-fully-qualified", "type-hint"],
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
{
|
|
pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
|
|
alias: "return-type",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
alias: ["class-name-fully-qualified", "return-type"],
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
],
|
|
constant: i,
|
|
function: {
|
|
pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
property: { pattern: /(->\s*)\w+/, lookbehind: !0 },
|
|
number: a,
|
|
operator: n,
|
|
punctuation: A,
|
|
}),
|
|
(o = [
|
|
{
|
|
pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
|
|
alias: "nowdoc-string",
|
|
greedy: !0,
|
|
inside: {
|
|
delimiter: {
|
|
pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
|
|
alias: "symbol",
|
|
inside: { punctuation: /^<<<'?|[';]$/ },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
pattern:
|
|
/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
|
|
alias: "heredoc-string",
|
|
greedy: !0,
|
|
inside: {
|
|
delimiter: {
|
|
pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
|
|
alias: "symbol",
|
|
inside: { punctuation: /^<<<"?|[";]$/ },
|
|
},
|
|
interpolation: (s = {
|
|
pattern:
|
|
/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
|
|
lookbehind: !0,
|
|
inside: e.languages.php,
|
|
}),
|
|
},
|
|
},
|
|
{
|
|
pattern: /`(?:\\[\s\S]|[^\\`])*`/,
|
|
alias: "backtick-quoted-string",
|
|
greedy: !0,
|
|
},
|
|
{
|
|
pattern: /'(?:\\[\s\S]|[^\\'])*'/,
|
|
alias: "single-quoted-string",
|
|
greedy: !0,
|
|
},
|
|
{
|
|
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
|
|
alias: "double-quoted-string",
|
|
greedy: !0,
|
|
inside: { interpolation: s },
|
|
},
|
|
]),
|
|
e.languages.insertBefore("php", "variable", {
|
|
string: o,
|
|
attribute: {
|
|
pattern:
|
|
/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
|
|
greedy: !0,
|
|
inside: {
|
|
"attribute-content": {
|
|
pattern: /^(#\[)[\s\S]+(?=\]$)/,
|
|
lookbehind: !0,
|
|
inside: {
|
|
comment: t,
|
|
string: o,
|
|
"attribute-class-name": [
|
|
{
|
|
pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
|
|
alias: "class-name",
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
},
|
|
{
|
|
pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
|
|
alias: ["class-name", "class-name-fully-qualified"],
|
|
greedy: !0,
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\\/ },
|
|
},
|
|
],
|
|
constant: i,
|
|
number: a,
|
|
operator: n,
|
|
punctuation: A,
|
|
},
|
|
},
|
|
delimiter: { pattern: /^#\[|\]$/, alias: "punctuation" },
|
|
},
|
|
},
|
|
}),
|
|
e.hooks.add("before-tokenize", function (t) {
|
|
/<\?/.test(t.code) &&
|
|
e.languages["markup-templating"].buildPlaceholders(
|
|
t,
|
|
"php",
|
|
/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g,
|
|
);
|
|
}),
|
|
e.hooks.add("after-tokenize", function (t) {
|
|
e.languages["markup-templating"].tokenizePlaceholders(t, "php");
|
|
});
|
|
}
|
|
(t.exports = a), (a.displayName = "php"), (a.aliases = []);
|
|
};
|
|
|
|
export default moduleFactory;
|