php-UERNR4D2.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/php/php.js
  3. var conf = {
  4. wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
  5. comments: {
  6. lineComment: "//",
  7. blockComment: ["/*", "*/"]
  8. },
  9. brackets: [
  10. ["{", "}"],
  11. ["[", "]"],
  12. ["(", ")"]
  13. ],
  14. autoClosingPairs: [
  15. { open: "{", close: "}", notIn: ["string"] },
  16. { open: "[", close: "]", notIn: ["string"] },
  17. { open: "(", close: ")", notIn: ["string"] },
  18. { open: '"', close: '"', notIn: ["string"] },
  19. { open: "'", close: "'", notIn: ["string", "comment"] }
  20. ],
  21. folding: {
  22. markers: {
  23. start: new RegExp("^\\s*(#|//)region\\b"),
  24. end: new RegExp("^\\s*(#|//)endregion\\b")
  25. }
  26. }
  27. };
  28. var language = {
  29. defaultToken: "",
  30. tokenPostfix: "",
  31. tokenizer: {
  32. root: [
  33. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.root" }],
  34. [/<!DOCTYPE/, "metatag.html", "@doctype"],
  35. [/<!--/, "comment.html", "@comment"],
  36. [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  37. [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
  38. [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
  39. [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  40. [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  41. [/</, "delimiter.html"],
  42. [/[^<]+/]
  43. ],
  44. doctype: [
  45. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
  46. [/[^>]+/, "metatag.content.html"],
  47. [/>/, "metatag.html", "@pop"]
  48. ],
  49. comment: [
  50. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
  51. [/-->/, "comment.html", "@pop"],
  52. [/[^-]+/, "comment.content.html"],
  53. [/./, "comment.content.html"]
  54. ],
  55. otherTag: [
  56. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.otherTag" }],
  57. [/\/?>/, "delimiter.html", "@pop"],
  58. [/"([^"]*)"/, "attribute.value"],
  59. [/'([^']*)'/, "attribute.value"],
  60. [/[\w\-]+/, "attribute.name"],
  61. [/=/, "delimiter"],
  62. [/[ \t\r\n]+/]
  63. ],
  64. script: [
  65. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.script" }],
  66. [/type/, "attribute.name", "@scriptAfterType"],
  67. [/"([^"]*)"/, "attribute.value"],
  68. [/'([^']*)'/, "attribute.value"],
  69. [/[\w\-]+/, "attribute.name"],
  70. [/=/, "delimiter"],
  71. [
  72. />/,
  73. {
  74. token: "delimiter.html",
  75. next: "@scriptEmbedded.text/javascript",
  76. nextEmbedded: "text/javascript"
  77. }
  78. ],
  79. [/[ \t\r\n]+/],
  80. [
  81. /(<\/)(script\s*)(>)/,
  82. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  83. ]
  84. ],
  85. scriptAfterType: [
  86. [
  87. /<\?((php)|=)?/,
  88. {
  89. token: "@rematch",
  90. switchTo: "@phpInSimpleState.scriptAfterType"
  91. }
  92. ],
  93. [/=/, "delimiter", "@scriptAfterTypeEquals"],
  94. [
  95. />/,
  96. {
  97. token: "delimiter.html",
  98. next: "@scriptEmbedded.text/javascript",
  99. nextEmbedded: "text/javascript"
  100. }
  101. ],
  102. [/[ \t\r\n]+/],
  103. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  104. ],
  105. scriptAfterTypeEquals: [
  106. [
  107. /<\?((php)|=)?/,
  108. {
  109. token: "@rematch",
  110. switchTo: "@phpInSimpleState.scriptAfterTypeEquals"
  111. }
  112. ],
  113. [
  114. /"([^"]*)"/,
  115. {
  116. token: "attribute.value",
  117. switchTo: "@scriptWithCustomType.$1"
  118. }
  119. ],
  120. [
  121. /'([^']*)'/,
  122. {
  123. token: "attribute.value",
  124. switchTo: "@scriptWithCustomType.$1"
  125. }
  126. ],
  127. [
  128. />/,
  129. {
  130. token: "delimiter.html",
  131. next: "@scriptEmbedded.text/javascript",
  132. nextEmbedded: "text/javascript"
  133. }
  134. ],
  135. [/[ \t\r\n]+/],
  136. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  137. ],
  138. scriptWithCustomType: [
  139. [
  140. /<\?((php)|=)?/,
  141. {
  142. token: "@rematch",
  143. switchTo: "@phpInSimpleState.scriptWithCustomType.$S2"
  144. }
  145. ],
  146. [
  147. />/,
  148. {
  149. token: "delimiter.html",
  150. next: "@scriptEmbedded.$S2",
  151. nextEmbedded: "$S2"
  152. }
  153. ],
  154. [/"([^"]*)"/, "attribute.value"],
  155. [/'([^']*)'/, "attribute.value"],
  156. [/[\w\-]+/, "attribute.name"],
  157. [/=/, "delimiter"],
  158. [/[ \t\r\n]+/],
  159. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  160. ],
  161. scriptEmbedded: [
  162. [
  163. /<\?((php)|=)?/,
  164. {
  165. token: "@rematch",
  166. switchTo: "@phpInEmbeddedState.scriptEmbedded.$S2",
  167. nextEmbedded: "@pop"
  168. }
  169. ],
  170. [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  171. ],
  172. style: [
  173. [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.style" }],
  174. [/type/, "attribute.name", "@styleAfterType"],
  175. [/"([^"]*)"/, "attribute.value"],
  176. [/'([^']*)'/, "attribute.value"],
  177. [/[\w\-]+/, "attribute.name"],
  178. [/=/, "delimiter"],
  179. [
  180. />/,
  181. {
  182. token: "delimiter.html",
  183. next: "@styleEmbedded.text/css",
  184. nextEmbedded: "text/css"
  185. }
  186. ],
  187. [/[ \t\r\n]+/],
  188. [
  189. /(<\/)(style\s*)(>)/,
  190. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  191. ]
  192. ],
  193. styleAfterType: [
  194. [
  195. /<\?((php)|=)?/,
  196. {
  197. token: "@rematch",
  198. switchTo: "@phpInSimpleState.styleAfterType"
  199. }
  200. ],
  201. [/=/, "delimiter", "@styleAfterTypeEquals"],
  202. [
  203. />/,
  204. {
  205. token: "delimiter.html",
  206. next: "@styleEmbedded.text/css",
  207. nextEmbedded: "text/css"
  208. }
  209. ],
  210. [/[ \t\r\n]+/],
  211. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  212. ],
  213. styleAfterTypeEquals: [
  214. [
  215. /<\?((php)|=)?/,
  216. {
  217. token: "@rematch",
  218. switchTo: "@phpInSimpleState.styleAfterTypeEquals"
  219. }
  220. ],
  221. [
  222. /"([^"]*)"/,
  223. {
  224. token: "attribute.value",
  225. switchTo: "@styleWithCustomType.$1"
  226. }
  227. ],
  228. [
  229. /'([^']*)'/,
  230. {
  231. token: "attribute.value",
  232. switchTo: "@styleWithCustomType.$1"
  233. }
  234. ],
  235. [
  236. />/,
  237. {
  238. token: "delimiter.html",
  239. next: "@styleEmbedded.text/css",
  240. nextEmbedded: "text/css"
  241. }
  242. ],
  243. [/[ \t\r\n]+/],
  244. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  245. ],
  246. styleWithCustomType: [
  247. [
  248. /<\?((php)|=)?/,
  249. {
  250. token: "@rematch",
  251. switchTo: "@phpInSimpleState.styleWithCustomType.$S2"
  252. }
  253. ],
  254. [
  255. />/,
  256. {
  257. token: "delimiter.html",
  258. next: "@styleEmbedded.$S2",
  259. nextEmbedded: "$S2"
  260. }
  261. ],
  262. [/"([^"]*)"/, "attribute.value"],
  263. [/'([^']*)'/, "attribute.value"],
  264. [/[\w\-]+/, "attribute.name"],
  265. [/=/, "delimiter"],
  266. [/[ \t\r\n]+/],
  267. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  268. ],
  269. styleEmbedded: [
  270. [
  271. /<\?((php)|=)?/,
  272. {
  273. token: "@rematch",
  274. switchTo: "@phpInEmbeddedState.styleEmbedded.$S2",
  275. nextEmbedded: "@pop"
  276. }
  277. ],
  278. [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  279. ],
  280. phpInSimpleState: [
  281. [/<\?((php)|=)?/, "metatag.php"],
  282. [/\?>/, { token: "metatag.php", switchTo: "@$S2.$S3" }],
  283. { include: "phpRoot" }
  284. ],
  285. phpInEmbeddedState: [
  286. [/<\?((php)|=)?/, "metatag.php"],
  287. [
  288. /\?>/,
  289. {
  290. token: "metatag.php",
  291. switchTo: "@$S2.$S3",
  292. nextEmbedded: "$S3"
  293. }
  294. ],
  295. { include: "phpRoot" }
  296. ],
  297. phpRoot: [
  298. [
  299. /[a-zA-Z_]\w*/,
  300. {
  301. cases: {
  302. "@phpKeywords": { token: "keyword.php" },
  303. "@phpCompileTimeConstants": { token: "constant.php" },
  304. "@default": "identifier.php"
  305. }
  306. }
  307. ],
  308. [
  309. /[$a-zA-Z_]\w*/,
  310. {
  311. cases: {
  312. "@phpPreDefinedVariables": {
  313. token: "variable.predefined.php"
  314. },
  315. "@default": "variable.php"
  316. }
  317. }
  318. ],
  319. [/[{}]/, "delimiter.bracket.php"],
  320. [/[\[\]]/, "delimiter.array.php"],
  321. [/[()]/, "delimiter.parenthesis.php"],
  322. [/[ \t\r\n]+/],
  323. [/(#|\/\/)$/, "comment.php"],
  324. [/(#|\/\/)/, "comment.php", "@phpLineComment"],
  325. [/\/\*/, "comment.php", "@phpComment"],
  326. [/"/, "string.php", "@phpDoubleQuoteString"],
  327. [/'/, "string.php", "@phpSingleQuoteString"],
  328. [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/, "delimiter.php"],
  329. [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.php"],
  330. [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.php"],
  331. [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.php"],
  332. [/0[0-7']*[0-7]/, "number.octal.php"],
  333. [/0[bB][0-1']*[0-1]/, "number.binary.php"],
  334. [/\d[\d']*/, "number.php"],
  335. [/\d/, "number.php"]
  336. ],
  337. phpComment: [
  338. [/\*\//, "comment.php", "@pop"],
  339. [/[^*]+/, "comment.php"],
  340. [/./, "comment.php"]
  341. ],
  342. phpLineComment: [
  343. [/\?>/, { token: "@rematch", next: "@pop" }],
  344. [/.$/, "comment.php", "@pop"],
  345. [/[^?]+$/, "comment.php", "@pop"],
  346. [/[^?]+/, "comment.php"],
  347. [/./, "comment.php"]
  348. ],
  349. phpDoubleQuoteString: [
  350. [/[^\\"]+/, "string.php"],
  351. [/@escapes/, "string.escape.php"],
  352. [/\\./, "string.escape.invalid.php"],
  353. [/"/, "string.php", "@pop"]
  354. ],
  355. phpSingleQuoteString: [
  356. [/[^\\']+/, "string.php"],
  357. [/@escapes/, "string.escape.php"],
  358. [/\\./, "string.escape.invalid.php"],
  359. [/'/, "string.php", "@pop"]
  360. ]
  361. },
  362. phpKeywords: [
  363. "abstract",
  364. "and",
  365. "array",
  366. "as",
  367. "break",
  368. "callable",
  369. "case",
  370. "catch",
  371. "cfunction",
  372. "class",
  373. "clone",
  374. "const",
  375. "continue",
  376. "declare",
  377. "default",
  378. "do",
  379. "else",
  380. "elseif",
  381. "enddeclare",
  382. "endfor",
  383. "endforeach",
  384. "endif",
  385. "endswitch",
  386. "endwhile",
  387. "extends",
  388. "false",
  389. "final",
  390. "for",
  391. "foreach",
  392. "function",
  393. "global",
  394. "goto",
  395. "if",
  396. "implements",
  397. "interface",
  398. "instanceof",
  399. "insteadof",
  400. "namespace",
  401. "new",
  402. "null",
  403. "object",
  404. "old_function",
  405. "or",
  406. "private",
  407. "protected",
  408. "public",
  409. "resource",
  410. "static",
  411. "switch",
  412. "throw",
  413. "trait",
  414. "try",
  415. "true",
  416. "use",
  417. "var",
  418. "while",
  419. "xor",
  420. "die",
  421. "echo",
  422. "empty",
  423. "exit",
  424. "eval",
  425. "include",
  426. "include_once",
  427. "isset",
  428. "list",
  429. "require",
  430. "require_once",
  431. "return",
  432. "print",
  433. "unset",
  434. "yield",
  435. "__construct"
  436. ],
  437. phpCompileTimeConstants: [
  438. "__CLASS__",
  439. "__DIR__",
  440. "__FILE__",
  441. "__LINE__",
  442. "__NAMESPACE__",
  443. "__METHOD__",
  444. "__FUNCTION__",
  445. "__TRAIT__"
  446. ],
  447. phpPreDefinedVariables: [
  448. "$GLOBALS",
  449. "$_SERVER",
  450. "$_GET",
  451. "$_POST",
  452. "$_FILES",
  453. "$_REQUEST",
  454. "$_SESSION",
  455. "$_ENV",
  456. "$_COOKIE",
  457. "$php_errormsg",
  458. "$HTTP_RAW_POST_DATA",
  459. "$http_response_header",
  460. "$argc",
  461. "$argv"
  462. ],
  463. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/
  464. };
  465. export {
  466. conf,
  467. language
  468. };
  469. /*! Bundled license information:
  470. monaco-editor/esm/vs/basic-languages/php/php.js:
  471. (*!-----------------------------------------------------------------------------
  472. * Copyright (c) Microsoft Corporation. All rights reserved.
  473. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  474. * Released under the MIT license
  475. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  476. *-----------------------------------------------------------------------------*)
  477. */
  478. //# sourceMappingURL=php-UERNR4D2.js.map