PageRenderTime 62ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/config/syntax/PHP.rb

http://github.com/manveru/ver
Ruby | 1154 lines | 1150 code | 1 blank | 3 comment | 1 complexity | 07430b025b382c13fd1dd6d370ceee3e MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. # Encoding: UTF-8
  2. {comment:
  3. "TODO:\n• Try to improve parameters list syntax – scope numbers, ‘=’, ‘,’ and possibly be intelligent about entity ordering\n• Is meta.function-call the correct scope? I've added it to my theme but by default it's not highlighted",
  4. firstLineMatch: "^#!.*(?<!-)php[0-9]{0,1}\\b",
  5. foldingStartMarker: /(?<_1>\/\*|\{\s*$|<<<HTML)/,
  6. foldingStopMarker: /(?<_1>\*\/|^\s*\}|^HTML;)/,
  7. name: "PHP",
  8. patterns:
  9. [{captures:
  10. {1 => {name: "punctuation.whitespace.embedded.leading.php"},
  11. 2 => {name: "source.php.embedded.line.empty.html"},
  12. 3 => {name: "punctuation.section.embedded.begin.php"},
  13. 4 => {name: "meta.consecutive-tags.php"},
  14. 5 => {name: "source.php"},
  15. 6 => {name: "punctuation.section.embedded.end.php"},
  16. 7 => {name: "source.php"},
  17. 8 => {name: "punctuation.whitespace.embedded.trailing.php"}},
  18. comment: "Matches empty tags.",
  19. match:
  20. /(?x)
  21. (?<_1>^\s*)? # 1 - Leading whitespace
  22. (?<_2> # 2 - meta.embedded.line.empty.php
  23. (?<_3> # 3 - Open Tag
  24. (?:
  25. (?<_4>(?<=\?>)<) # 4 - Consecutive tags
  26. | <
  27. )
  28. \?(?i:php|=)?
  29. )
  30. (?<_5>\s*) # 5 - Loneliness
  31. (?<_6>(?<_7>\?)>) # 6 - Close Tag
  32. # 7 - Scope ? as scope.php
  33. )
  34. (?<_8>
  35. \k<_1> # Match nothing if there was no
  36. # leading whitespace...
  37. | (?<_9>\s*$\n)? # or match trailing whitespace.
  38. )
  39. /},
  40. {begin: /^\s*(?=<\?)/,
  41. beginCaptures:
  42. {0 => {name: "punctuation.whitespace.embedded.leading.php"}},
  43. comment: "Catches tags with preceeding whitespace.",
  44. end: "(?<=\\?>)(\\s*$\\n)?",
  45. endCaptures: {0 => {name: "punctuation.whitespace.embedded.trailing.php"}},
  46. patterns:
  47. [{begin: /<\?(?i:php|=)?/,
  48. beginCaptures: {0 => {name: "punctuation.section.embedded.begin.php"}},
  49. end: "(\\?)>",
  50. endCaptures:
  51. {0 => {name: "punctuation.section.embedded.end.php"},
  52. 1 => {name: "source.php"}},
  53. name: "source.php.embedded.block.html",
  54. patterns: [{include: "#language"}]}]},
  55. {begin: /(?<_1>(?<_2>(?<=\?>)<)|<)\?(?i:php|=)?/,
  56. beginCaptures:
  57. {0 => {name: "punctuation.section.embedded.begin.php"},
  58. 2 => {name: "meta.consecutive-tags.php"}},
  59. comment: "Catches the remainder.",
  60. end: "(\\?)>",
  61. endCaptures:
  62. {0 => {name: "punctuation.section.embedded.end.php"},
  63. 1 => {name: "source.php"}},
  64. name: "source.php.embedded.line.html",
  65. patterns: [{include: "#language"}]}],
  66. repository:
  67. {constants:
  68. {patterns:
  69. [{match:
  70. /(?i)\b(?<_1>TRUE|FALSE|NULL|__(?<_2>FILE|FUNCTION|CLASS|METHOD|LINE)__|ON|OFF|YES|NO|NL|BR|TAB)\b/,
  71. name: "constant.language.php"},
  72. {match:
  73. /\b(?<_1>DEFAULT_INCLUDE_PATH|E_(?<_2>ALL|COMPILE_(?<_3>ERROR|WARNING)|CORE_(?<_4>ERROR|WARNING)|(?<_5>RECOVERABLE_)?ERROR|NOTICE|PARSE|STRICT|USER_(?<_6>ERROR|NOTICE|WARNING)|WARNING)|PEAR_(?<_7>EXTENSION_DIR|INSTALL_DIR)|PHP_(?<_8>BINDIR|CONFIG_FILE_PATH|DATADIR|E(?<_9>OL|XTENSION_DIR)|L(?<_10>IBDIR|OCALSTATEDIR)|O(?<_11>S|UTPUT_HANDLER_CONT|UTPUT_HANDLER_END|UTPUT_HANDLER_START)|SYSCONFDIR|VERSION))\b/,
  74. name: "support.constant.core.php"},
  75. {match:
  76. /\b(?<_1>A(?<_2>B(?<_3>DAY_(?<_4>[1-7])|MON_(?<_5>[0-9]{1,2}))|LT_DIGITS|M_STR|SSERT_(?<_6>ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?<_7>ASE_(?<_8>LOWER|UPPER)|HAR_MAX|O(?<_9>DESET|NNECTION_(?<_10>ABORTED|NORMAL|TIMEOUT)|UNT_(?<_11>NORMAL|RECURSIVE))|REDITS_(?<_12>ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)|RNCYSTR|RYPT_(?<_13>BLOWFISH|EXT_DES|MD5|SALT_LENGTH|STD_DES)|URRENCY_SYMBOL)|D(?<_14>AY_(?<_15>[1-7])|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?<_16>FMT|T_FMT))|E(?<_17>NT_(?<_18>COMPAT|NOQUOTES|QUOTES)|RA(?<_19>|_D_FMT|_D_T_FMT|_T_FMT|_YEAR)|XTR_(?<_20>IF_EXISTS|OVERWRITE|PREFIX_(?<_21>ALL|IF_EXISTS|INVALID|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?<_22>ENTITIES|SPECIALCHARS)|IN(?<_23>FO_(?<_24>ALL|CONFIGURATION|CREDITS|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?<_25>ALL|PERDIR|SYSTEM|USER)|T_(?<_26>CURR_SYMBOL|FRAC_DIGITS))|L(?<_27>C_(?<_28>ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|O(?<_29>CK_(?<_30>EX|NB|SH|UN)|G_(?<_31>ALERT|AUTH(?<_32>|PRIV)|CONS|CRIT|CRON|DAEMON|DEBUG|EMERG|ERR|INFO|KERN|LOCAL(?<_33>[0-7])|LPR|MAIL|NDELAY|NEWS|NOTICE|NOWAIT|ODELAY|PERROR|PID|SYSLOG|USER|UUCP|WARNING)))|M(?<_34>ON_(?<_35>[0-9]{1,2}|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|YSQL_(?<_36>ASSOC|BOTH|NUM)|_(?<_37>1_PI|2_(?<_38>PI|SQRTPI)|E|L(?<_39>N10|N2|OG(?<_40>10E|2E))|PI(?<_41>|_2|_4)|SQRT1_2|SQRT2))|N(?<_42>EGATIVE_SIGN|O(?<_43>EXPR|STR)|_(?<_44>CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN))|P(?<_45>ATH(?<_46>INFO_(?<_47>BASENAME|DIRNAME|EXTENSION|FILENAME)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?<_48>CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN))|RADIXCHAR|S(?<_49>EEK_(?<_50>CUR|END|SET)|ORT_(?<_51>ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?<_52>BOTH|LEFT|RIGHT))|T(?<_53>HOUS(?<_54>ANDS_SEP|EP)|_(?<_55>FMT(?<_56>|_AMPM)))|YES(?<_57>EXPR|STR))\b/,
  77. name: "support.constant.std.php"},
  78. {comment:
  79. "In PHP, any identifier which is not a variable is taken to be a constant.\n\t\t\t\tHowever, if there is no constant defined with the given name then a notice\n\t\t\t\tis generated and the constant is assumed to have the value of its name.",
  80. match: /[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/n,
  81. name: "constant.other.php"}]},
  82. :"function-call" =>
  83. {match: /[A-Za-z_][A-Za-z_0-9]*(?=\s*\()/, name: "meta.function-call.php"},
  84. instantiation:
  85. {captures:
  86. {1 => {name: "keyword.other.new.php"},
  87. 2 => {name: "variable.other.php"},
  88. 3 => {name: "support.class.php"},
  89. 4 => {name: "support.class.php"}},
  90. match:
  91. /(?i)\b(?<_1>new)\s+(?:(?<_2>\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|(?<_3>\w+))|(?<_4>\w+)(?=::)/n},
  92. interpolation:
  93. {comment:
  94. "http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing",
  95. patterns:
  96. [{match: /\\[0-7]{1,3}/, name: "constant.numeric.octal.php"},
  97. {match: /\\x[0-9A-Fa-f]{1,2}/, name: "constant.numeric.hex.php"},
  98. {match: /\\[nrt\\\$\"]/, name: "constant.character.escape.php"},
  99. {captures:
  100. {1 => {name: "variable.other.php"},
  101. 2 => {name: "punctuation.definition.variable.php"},
  102. 4 => {name: "punctuation.definition.variable.php"}},
  103. comment: "Simple syntax with braces: \"foo${bar}baz\"",
  104. match:
  105. /(?x)
  106. (?<_1>(?<_2>\$\{)(?<name>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(?<_3>\}))
  107. /n},
  108. {captures:
  109. {1 => {name: "variable.other.php"},
  110. 10 => {name: "punctuation.definition.variable.php"},
  111. 11 => {name: "string.unquoted.index.php"},
  112. 12 => {name: "invalid.illegal.invalid-simple-array-index.php"},
  113. 13 => {name: "keyword.operator.index-end.php"},
  114. 2 => {name: "punctuation.definition.variable.php"},
  115. 4 => {name: "keyword.operator.class.php"},
  116. 5 => {name: "variable.other.property.php"},
  117. 6 => {name: "invalid.illegal.php"},
  118. 7 => {name: "keyword.operator.index-start.php"},
  119. 8 => {name: "constant.numeric.index.php"},
  120. 9 => {name: "variable.other.index.php"}},
  121. comment: "Simple syntax: $foo, $foo[0], $foo[$bar], $foo->bar",
  122. match:
  123. /(?x)
  124. (?<_1>(?<_2>\$)(?<name>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))
  125. (?:
  126. (?<_3>->)
  127. (?:
  128. (?<_4>\g<name>)
  129. |
  130. (?<_5>\$\g<name>)
  131. )
  132. |
  133. (?<_6>\[)
  134. (?:(?<_7>\d+)|(?<_8>(?<_9>\$)\g<name>)|(?<_10>\w+)|(?<_11>.*?))
  135. (?<_12>\])
  136. )?
  137. /n},
  138. {begin:
  139. /(?=(?<regex>(?#simple syntax)\$(?<name>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(?:\[(?<index>[a-zA-Z0-9_\x7f-\xff]+|\$\g<name>)\]|->\g<name>(?<_1>\(.*?\))?)?|(?#simple syntax with braces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complex syntax)\{(?<complex>\$(?<segment>\g<name>(?<_2>\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/n,
  140. beginCaptures: {0 => {name: "punctuation.definition.variable.php"}},
  141. comment:
  142. "Complex syntax. It seems this now supports complex method calls, as of PHP5.\n\t\t\t\t\t\t\t I've put wildcards into the function call parameter lists to handle this, but this may break the pattern.\n\t\t\t\t\t\t\t It also might be better to disable it as I shouldn't imagine it's used often (hopefully) and it may confuse PHP4 users.",
  143. end: "\\}",
  144. endCaptures: {0 => {name: "punctuation.definition.variable.php"}},
  145. patterns:
  146. [{include: "#function-call"},
  147. {include: "#var_basic"},
  148. {include: "#object"},
  149. {include: "#numbers"},
  150. {match: /\[/, name: "keyword.operator.index-start.php"},
  151. {match: /\]/, name: "keyword.operator.index-end.php"}]}]},
  152. language:
  153. {patterns:
  154. [{begin: /(?=<<<\s*(?<_1>HTML|XML|SQL|JAVASCRIPT|CSS)\s*$)/,
  155. end: "(?!<?<<\\s*(HTML|XML|SQL|JAVASCRIPT|CSS)\\s*$)",
  156. name: "string.unquoted.heredoc.php",
  157. patterns:
  158. [{begin: /(?<_1><<<)\s*(?<_2>HTML)\s*$\n?/,
  159. beginCaptures:
  160. {0 => {name: "punctuation.section.embedded.begin.php"},
  161. 1 => {name: "punctuation.definition.string.php"},
  162. 2 => {name: "keyword.operator.heredoc.php"}},
  163. contentName: "text.html",
  164. end: "^(HTML)(;?)$\\n?",
  165. endCaptures:
  166. {0 => {name: "punctuation.section.embedded.end.php"},
  167. 1 => {name: "keyword.operator.heredoc.php"},
  168. 2 => {name: "punctuation.definition.string.php"}},
  169. name: "meta.embedded.html",
  170. patterns:
  171. [{include: "text.html.basic"}, {include: "#interpolation"}]},
  172. {begin: /(?<_1><<<)\s*(?<_2>XML)\s*$\n?/,
  173. beginCaptures:
  174. {0 => {name: "punctuation.section.embedded.begin.php"},
  175. 1 => {name: "punctuation.definition.string.php"},
  176. 2 => {name: "keyword.operator.heredoc.php"}},
  177. contentName: "text.xml",
  178. end: "^(XML)(;?)$\\n?",
  179. endCaptures:
  180. {0 => {name: "punctuation.section.embedded.end.php"},
  181. 1 => {name: "keyword.operator.heredoc.php"},
  182. 2 => {name: "punctuation.definition.string.php"}},
  183. name: "meta.embedded.xml",
  184. patterns: [{include: "text.xml"}, {include: "#interpolation"}]},
  185. {begin: /(?<_1><<<)\s*(?<_2>SQL)\s*$\n?/,
  186. beginCaptures:
  187. {0 => {name: "punctuation.section.embedded.begin.php"},
  188. 1 => {name: "punctuation.definition.string.php"},
  189. 2 => {name: "keyword.operator.heredoc.php"}},
  190. contentName: "source.sql",
  191. end: "^(SQL)(;?)$\\n?",
  192. endCaptures:
  193. {0 => {name: "punctuation.section.embedded.end.php"},
  194. 1 => {name: "keyword.operator.heredoc.php"},
  195. 2 => {name: "punctuation.definition.string.php"}},
  196. name: "meta.embedded.sql",
  197. patterns: [{include: "source.sql"}, {include: "#interpolation"}]},
  198. {begin: /(?<_1><<<)\s*(?<_2>JAVASCRIPT)\s*$\n?/,
  199. beginCaptures:
  200. {0 => {name: "punctuation.section.embedded.begin.php"},
  201. 1 => {name: "punctuation.definition.string.php"},
  202. 2 => {name: "keyword.operator.heredoc.php"}},
  203. contentName: "source.js",
  204. end: "^(JAVASCRIPT)(;?)$\\n?",
  205. endCaptures:
  206. {0 => {name: "punctuation.section.embedded.end.php"},
  207. 1 => {name: "keyword.operator.heredoc.php"},
  208. 2 => {name: "punctuation.definition.string.php"}},
  209. name: "meta.embedded.js",
  210. patterns: [{include: "source.js"}, {include: "#interpolation"}]},
  211. {begin: /(?<_1><<<)\s*(?<_2>CSS)\s*$\n?/,
  212. beginCaptures:
  213. {0 => {name: "punctuation.section.embedded.begin.php"},
  214. 1 => {name: "punctuation.definition.string.php"},
  215. 2 => {name: "keyword.operator.heredoc.php"}},
  216. contentName: "source.css",
  217. end: "^(CSS)(;?)$\\n?",
  218. endCaptures:
  219. {0 => {name: "punctuation.section.embedded.end.php"},
  220. 1 => {name: "keyword.operator.heredoc.php"},
  221. 2 => {name: "punctuation.definition.string.php"}},
  222. name: "meta.embedded.css",
  223. patterns: [{include: "source.css"}, {include: "#interpolation"}]}]},
  224. {begin: /\/\*\*(?:\#@\+)?\s*$/,
  225. captures: {0 => {name: "punctuation.definition.comment.php"}},
  226. comment:
  227. "This now only highlights a docblock if the first line contains only /**\n\t\t\t\t\t\t\t\t- this is to stop highlighting everything as invalid when people do comment banners with /******** ...\n\t\t\t\t\t\t\t\t- Now matches /**\#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate",
  228. end: "\\*/",
  229. name: "comment.block.documentation.phpdoc.php",
  230. patterns: [{include: "#php_doc"}]},
  231. {begin: /\/\*/,
  232. captures: {0 => {name: "punctuation.definition.comment.php"}},
  233. end: "\\*/",
  234. name: "comment.block.php"},
  235. {captures: {1 => {name: "punctuation.definition.comment.php"}},
  236. match: /(?<_1>\/\/).*?(?<_2>$\n?|(?=\?>))/,
  237. name: "comment.line.double-slash.php"},
  238. {captures: {1 => {name: "punctuation.definition.comment.php"}},
  239. match: /(?<_1>#).*?(?<_2>$\n?|(?=\?>))/,
  240. name: "comment.line.number-sign.php"},
  241. {begin:
  242. /^(?i)\s*(?<_1>interface)\s+(?<_2>[a-z0-9_]+)\s*(?<_3>extends)?\s*/,
  243. beginCaptures:
  244. {1 => {name: "storage.type.interface.php"},
  245. 2 => {name: "entity.name.type.interface.php"},
  246. 3 => {name: "storage.modifier.extends.php"}},
  247. end: "$",
  248. name: "meta.interface.php",
  249. patterns:
  250. [{match: /[a-zA-Z0-9_]+/, name: "entity.other.inherited-class.php"}]},
  251. {begin:
  252. /(?i)^\s*(?<_1>abstract|final)?\s*(?<_2>class)\s+(?<_3>[a-z0-9_]+)\s*/,
  253. beginCaptures:
  254. {1 => {name: "storage.modifier.abstract.php"},
  255. 2 => {name: "storage.type.class.php"},
  256. 3 => {name: "entity.name.type.class.php"}},
  257. end: "$",
  258. name: "meta.class.php",
  259. patterns:
  260. [{captures:
  261. {1 => {name: "storage.modifier.extends.php"},
  262. 2 => {name: "entity.other.inherited-class.php"}},
  263. match: /(?i:(?<_1>extends))\s+(?<_2>[a-zA-Z0-9_]+)\s*/},
  264. {begin: /(?i:(?<_1>implements))\s+(?<_2>[a-zA-Z0-9_]+)\s*/,
  265. beginCaptures:
  266. {1 => {name: "storage.modifier.implements.php"},
  267. 2 => {name: "support.class.implements.php"}},
  268. end: "(?=\\s*\\b(?i:(extends)))|$",
  269. patterns:
  270. [{captures: {1 => {name: "support.class.implements.php"}},
  271. match: /,\s*(?<_1>[a-zA-Z0-9_]+)\s*/}]}]},
  272. {match:
  273. /\b(?<_1>break|c(?<_2>ase|ontinue)|d(?<_3>e(?<_4>clare|fault)|ie|o)|e(?<_5>lse(?<_6>if)?|nd(?<_7>declare|for(?<_8>each)?|if|switch|while)|xit)|for(?<_9>each)?|if|return|switch|use|while)\b/,
  274. name: "keyword.control.php"},
  275. {begin: /(?i)\b(?<_1>(?:require|include)(?:_once)?)\b\s*/,
  276. beginCaptures: {1 => {name: "keyword.control.import.include.php"}},
  277. end: "(?=\\s|;|$)",
  278. name: "meta.include.php",
  279. patterns: [{include: "#language"}]},
  280. {captures:
  281. {1 => {name: "keyword.control.exception.php"},
  282. 2 => {name: "support.class.php"},
  283. 3 => {name: "variable.other.php"},
  284. 4 => {name: "punctuation.definition.variable.php"}},
  285. match:
  286. /\b(?<_1>catch)\b\s*\(\s*(?<_2>[A-Za-z_][A-Za-z_0-9]*)\s*(?<_3>(?<_4>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*\)/n,
  287. name: "meta.catch.php"},
  288. {match: /\b(?<_1>catch|try|throw|exception)\b/,
  289. name: "keyword.control.exception.php"},
  290. {begin:
  291. /(?:^\s*)(?<_1>(?:(?:final|abstract|public|private|protected|static)\s+)*)(?<_2>function)(?:\s+|(?<_3>\s*&\s*))(?:(?<_4>__(?:call|(?:con|de)struct|get|(?:is|un)?set|tostring|clone|set_state|sleep|wakeup|autoload))|(?<_5>[a-zA-Z0-9_]+))\s*(?<_6>\()/,
  292. beginCaptures:
  293. {1 => {name: "storage.modifier.php"},
  294. 2 => {name: "storage.type.function.php"},
  295. 3 => {name: "storage.modifier.reference.php"},
  296. 4 => {name: "support.function.magic.php"},
  297. 5 => {name: "entity.name.function.php"},
  298. 6 => {name: "punctuation.definition.parameters.begin.php"}},
  299. contentName: "meta.function.arguments.php",
  300. end: "\\)",
  301. endCaptures:
  302. {1 => {name: "punctuation.definition.parameters.end.php"}},
  303. name: "meta.function.php",
  304. patterns:
  305. [{begin:
  306. /(?x)
  307. \s*(?<_1>array) # Typehint
  308. \s*(?<_2>&)? # Reference
  309. \s*(?<_3>(?<_4>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*) # The variable name
  310. \s*(?<_5>=) # A default value
  311. \s*(?<_6>array)\s*(?<_7>\()
  312. /n,
  313. beginCaptures:
  314. {1 => {name: "storage.type.php"},
  315. 2 => {name: "storage.modifier.php"},
  316. 3 => {name: "variable.other.php"},
  317. 4 => {name: "punctuation.definition.variable.php"},
  318. 5 => {name: "keyword.operator.assignment.php"},
  319. 6 => {name: "support.function.construct.php"},
  320. 7 => {name: "punctuation.definition.array.begin.php"}},
  321. contentName: "meta.array.php",
  322. end: "\\)",
  323. endCaptures: {0 => {name: "punctuation.definition.array.end.php"}},
  324. name: "meta.function.argument.array.php",
  325. patterns: [{include: "#strings"}, {include: "#numbers"}]},
  326. {captures:
  327. {1 => {name: "storage.type.php"},
  328. 2 => {name: "storage.modifier.php"},
  329. 3 => {name: "variable.other.php"},
  330. 4 => {name: "punctuation.definition.variable.php"},
  331. 5 => {name: "keyword.operator.assignment.php"},
  332. 6 => {name: "constant.language.php"},
  333. 7 => {name: "invalid.illegal.non-null-typehinted.php"}},
  334. match:
  335. /(?x)
  336. \s*(?<_1>array) # Typehint
  337. \s*(?<_2>&)? # Reference
  338. \s*(?<_3>(?<_4>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*) # The variable name
  339. (?:
  340. \s*(?<_5>=) # A default value
  341. \s*(?i:
  342. (?<_6>NULL)
  343. |
  344. (?<_7>\S.*?)
  345. )?
  346. )?
  347. \s*(?=,|\)) # A closing parentheses (?<_8>end of argument list) or a comma
  348. /n,
  349. name: "meta.function.argument.array.php"},
  350. {captures:
  351. {1 => {name: "support.class.php"},
  352. 2 => {name: "storage.modifier.php"},
  353. 3 => {name: "variable.other.php"},
  354. 4 => {name: "punctuation.definition.variable.php"},
  355. 5 => {name: "keyword.operator.assignment.php"},
  356. 6 => {name: "constant.language.php"},
  357. 7 => {name: "invalid.illegal.non-null-typehinted.php"}},
  358. match:
  359. /(?x)
  360. \s*(?<_1>[A-Za-z_][A-Za-z_0-9]*) # Typehinted class name
  361. \s*(?<_2>&)? # Reference
  362. \s*(?<_3>(?<_4>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*) # The variable name
  363. (?:
  364. \s*(?<_5>=) # A default value
  365. \s*(?i:
  366. (?<_6>NULL)
  367. |
  368. (?<_7>\S.*?)
  369. )?
  370. )?
  371. \s*(?=,|\)) # A closing parentheses (?<_8>end of argument list) or a comma
  372. /n,
  373. name: "meta.function.argument.typehinted.php"},
  374. {captures:
  375. {1 => {name: "storage.modifier.php"},
  376. 2 => {name: "variable.other.php"},
  377. 3 => {name: "punctuation.definition.variable.php"}},
  378. match:
  379. /(?<_1>\s*&)?\s*(?<_2>(?<_3>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(?=,|\))/n,
  380. name: "meta.function.argument.no-default.php"},
  381. {begin:
  382. /(?<_1>\s*&)?\s*(?<_2>(?<_3>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(?:\s*(?<_4>=)\s*)\s*/n,
  383. captures:
  384. {1 => {name: "storage.modifier.php"},
  385. 2 => {name: "variable.other.php"},
  386. 3 => {name: "punctuation.definition.variable.php"},
  387. 4 => {name: "keyword.operator.assignment.php"}},
  388. end: "(?=,|\\))",
  389. name: "meta.function.argument.default.php",
  390. patterns: [{include: "#parameter-default-types"}]},
  391. {begin: /\/\*/,
  392. captures: {0 => {name: "punctuation.definition.comment.php"}},
  393. end: "\\*/",
  394. name: "comment.block.php"}]},
  395. {match:
  396. /(?i)\b(?<_1>real|double|float|int(?<_2>eger)?|bool(?<_3>ean)?|string|class|clone|var|function|interface|parent|self|object)\b/,
  397. name: "storage.type.php"},
  398. {match:
  399. /(?i)\b(?<_1>global|abstract|const|extends|implements|final|p(?<_2>r(?<_3>ivate|otected)|ublic)|static)\b/,
  400. name: "storage.modifier.php"},
  401. {include: "#object"},
  402. {captures:
  403. {1 => {name: "keyword.operator.class.php"},
  404. 2 => {name: "meta.function-call.static.php"},
  405. 3 => {name: "variable.other.class.php"},
  406. 4 => {name: "punctuation.definition.variable.php"},
  407. 5 => {name: "constant.other.class.php"}},
  408. match:
  409. /(?x)(?<_1>::)
  410. (?:
  411. (?<_2>[A-Za-z_][A-Za-z_0-9]*)\s*\(
  412. |
  413. (?<_3>(?<_4>\$+)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
  414. |
  415. (?<_5>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
  416. )?/n},
  417. {include: "#support"},
  418. {begin: /(?<_1><<<)\s*(?<_2>[a-zA-Z_]+[a-zA-Z0-9_]*)/,
  419. beginCaptures:
  420. {1 => {name: "punctuation.definition.string.php"},
  421. 2 => {name: "keyword.operator.heredoc.php"}},
  422. end: "^(\\2)(;?)$",
  423. endCaptures:
  424. {1 => {name: "keyword.operator.heredoc.php"},
  425. 2 => {name: "punctuation.definition.string.php"}},
  426. name: "string.unquoted.heredoc.php",
  427. patterns: [{include: "#interpolation"}]},
  428. {match: /=>/, name: "keyword.operator.key.php"},
  429. {match: /&(?=\s*(?<_1>\$|new|[A-Za-z_][A-Za-z_0-9]+(?=\s*\()))/,
  430. name: "storage.modifier.reference.php"},
  431. {match: /;/, name: "punctuation.terminator.expression.php"},
  432. {match: /(?<_1>@)/, name: "keyword.operator.error-control.php"},
  433. {match: /(?<_1>\-\-|\+\+)/,
  434. name: "keyword.operator.increment-decrement.php"},
  435. {match: /(?<_1>\-|\+|\*|\/|%)/,
  436. name: "keyword.operator.arithmetic.php"},
  437. {match: /(?i)(?<_1>!|&&|\|\|)|\b(?<_2>and|or|xor|as)\b/,
  438. name: "keyword.operator.logical.php"},
  439. {match: /<<|>>|~|\^|&|\|/, name: "keyword.operator.bitwise.php"},
  440. {match: /(?<_1>===|==|!==|!=|<=|>=|<>|<|>)/,
  441. name: "keyword.operator.comparison.php"},
  442. {match: /(?<_1>\.=|\.)/, name: "keyword.operator.string.php"},
  443. {match: /=/, name: "keyword.operator.assignment.php"},
  444. {captures:
  445. {1 => {name: "keyword.operator.type.php"},
  446. 2 => {name: "support.class.php"}},
  447. match: /(?i)\b(?<_1>instanceof)\b(?:\s+(?<_2>\w+))?/},
  448. {include: "#numbers"},
  449. {include: "#strings"},
  450. {include: "#string-backtick"},
  451. {include: "#function-call"},
  452. {include: "#variables"},
  453. {captures:
  454. {1 => {name: "keyword.operator.php"},
  455. 2 => {name: "variable.other.property.php"}},
  456. match:
  457. /(?<=[a-zA-Z0-9_\x7f-\xff])(?<_1>->)(?<_2>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*?)\b/n},
  458. {include: "#instantiation"},
  459. {include: "#constants"}]},
  460. numbers:
  461. {match:
  462. /\b(?<_1>(?<_2>0(?<_3>x|X)[0-9a-fA-F]*)|(?<_4>(?<_5>[0-9]+\.?[0-9]*)|(?<_6>\.[0-9]+))(?<_7>(?<_8>e|E)(?<_9>\+|-)?[0-9]+)?)\b/,
  463. name: "constant.numeric.php"},
  464. object:
  465. {captures:
  466. {1 => {name: "keyword.operator.class.php"},
  467. 2 => {name: "meta.function-call.object.php"},
  468. 3 => {name: "variable.other.property.php"},
  469. 4 => {name: "punctuation.definition.variable.php"}},
  470. match:
  471. /(?x)(?<_1>->)
  472. (?:
  473. (?<_2>[A-Za-z_][A-Za-z_0-9]*)\s*\(
  474. |
  475. (?<_3>(?<_4>\$+)?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
  476. )?/n},
  477. :"parameter-default-types" =>
  478. {patterns:
  479. [{include: "#strings"},
  480. {include: "#numbers"},
  481. {include: "#string-backtick"},
  482. {include: "#variables"},
  483. {match: /=>/, name: "keyword.operator.key.php"},
  484. {match: /=/, name: "keyword.operator.assignment.php"},
  485. {match: /&(?=\s*\$)/, name: "storage.modifier.reference.php"},
  486. {begin: /(?<_1>array)\s*(?<_2>\()/,
  487. beginCaptures:
  488. {1 => {name: "support.function.construct.php"},
  489. 2 => {name: "punctuation.definition.array.begin.php"}},
  490. end: "\\)",
  491. endCaptures: {0 => {name: "punctuation.definition.array.end.php"}},
  492. name: "meta.array.php",
  493. patterns: [{include: "#parameter-default-types"}]},
  494. {include: "#instantiation"},
  495. {include: "#constants"}]},
  496. php_doc:
  497. {patterns:
  498. [{comment:
  499. "PHPDocumentor only recognises lines with an asterisk as the first non-whitespaces character",
  500. match: /^(?!\s*\*).*$\n?/,
  501. name: "invalid.illegal.missing-asterisk.phpdoc.php"},
  502. {captures:
  503. {1 => {name: "keyword.other.phpdoc.php"},
  504. 3 => {name: "storage.modifier.php"},
  505. 4 => {name: "invalid.illegal.wrong-access-type.phpdoc.php"}},
  506. match:
  507. /^\s*\*\s*(?<_1>@access)\s+(?<_2>(?<_3>public|private|protected)|(?<_4>.+))\s*$/},
  508. {match:
  509. /(?<_1>(?<_2>https?|s?ftp|ftps|file|smb|afp|nfs|(?<_3>x-)?man|gopher|txmt):\/\/|mailto:)[-:@a-zA-Z0-9_.~%+\/?=&#]+(?<![.?:])/,
  510. name: "markup.underline.link.php"},
  511. {captures:
  512. {1 => {name: "keyword.other.phpdoc.php"},
  513. 2 => {name: "markup.underline.link.php"}},
  514. match: /(?<_1>@xlink)\s+(?<_2>.+)\s*$/},
  515. {match:
  516. /\@(?<_1>a(?<_2>bstract|uthor)|c(?<_3>ategory|opyright)|example|global|internal|li(?<_4>cense|nk)|pa(?<_5>ckage|ram)|return|s(?<_6>ee|ince|tatic|ubpackage)|t(?<_7>hrows|odo)|v(?<_8>ar|ersion)|uses|deprecated|final)\b/,
  517. name: "keyword.other.phpdoc.php"},
  518. {captures: {1 => {name: "keyword.other.phpdoc.php"}},
  519. match: /\{(?<_1>@(?<_2>link)).+?\}/,
  520. name: "meta.tag.inline.phpdoc.php"}]},
  521. :"regex-double-quoted" =>
  522. {begin: /(?x)"\/ (?= (?<_1>\\.|[^"\/])++\/[imsxeADSUXu]*" )/,
  523. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  524. end: "(/)([imsxeADSUXu]*)(\")",
  525. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  526. name: "string.regexp.double-quoted.php",
  527. patterns:
  528. [{comment:
  529. "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)",
  530. match: /(?<_1>\\){1,2}[.$^\[\]{}]/,
  531. name: "constant.character.escape.regex.php"},
  532. {include: "#interpolation"},
  533. {captures:
  534. {1 => {name: "punctuation.definition.arbitrary-repitition.php"},
  535. 3 => {name: "punctuation.definition.arbitrary-repitition.php"}},
  536. match: /(?<_1>\{)\d+(?<_2>,\d+)?(?<_3>\})/,
  537. name: "string.regexp.arbitrary-repitition.php"},
  538. {begin: /\[(?:\^?\])?/,
  539. captures: {0 => {name: "punctuation.definition.character-class.php"}},
  540. end: "\\]",
  541. name: "string.regexp.character-class.php",
  542. patterns: [{include: "#interpolation"}]},
  543. {match: /[$^+*]/, name: "keyword.operator.regexp.php"}]},
  544. :"regex-single-quoted" =>
  545. {begin: /(?x)'\/ (?= (?<_1>\\.|[^'\/])++\/[imsxeADSUXu]*' )/,
  546. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  547. end: "(/)([imsxeADSUXu]*)(')",
  548. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  549. name: "string.regexp.single-quoted.php",
  550. patterns:
  551. [{captures:
  552. {1 => {name: "punctuation.definition.arbitrary-repitition.php"},
  553. 3 => {name: "punctuation.definition.arbitrary-repitition.php"}},
  554. match: /(?<_1>\{)\d+(?<_2>,\d+)?(?<_3>\})/,
  555. name: "string.regexp.arbitrary-repitition.php"},
  556. {comment:
  557. "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)",
  558. match: /(?<_1>\\){1,2}[.$^\[\]{}]/,
  559. name: "constant.character.escape.regex.php"},
  560. {comment:
  561. "Escaped from the PHP string – there can also be 2 backslashes (since 1 will escape the first)",
  562. match: /\\{1,2}[\\']/,
  563. name: "constant.character.escape.php"},
  564. {begin: /\[(?:\^?\])?/,
  565. captures: {0 => {name: "punctuation.definition.character-class.php"}},
  566. end: "\\]",
  567. name: "string.regexp.character-class.php",
  568. patterns:
  569. [{match: /\\[\\'\[\]]/, name: "constant.character.escape.php"}]},
  570. {match: /[$^+*]/, name: "keyword.operator.regexp.php"}]},
  571. :"sql-string-double-quoted" =>
  572. {begin:
  573. /"\s*(?=(?<_1>SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b)/,
  574. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  575. contentName: "source.sql.embedded.php",
  576. end: "\"",
  577. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  578. name: "string.quoted.double.sql.php",
  579. patterns:
  580. [{match: /#(?<_1>\\"|[^"])*(?="|$\n?)/,
  581. name: "comment.line.number-sign.sql"},
  582. {match: /--(?<_1>\\"|[^"])*(?="|$\n?)/,
  583. name: "comment.line.double-dash.sql"},
  584. {begin: /'(?=[^']*?")/,
  585. comment:
  586. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  587. end: "(?=\")",
  588. name: "string.quoted.single.unclosed.sql",
  589. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  590. {begin: /`(?=[^`]*?")/,
  591. comment:
  592. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  593. end: "(?=\")",
  594. name: "string.quoted.other.backtick.unclosed.sql",
  595. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  596. {begin: /\\"(?!(?<_1>[^\\"]|\\[^"])*\\")(?=(?<_2>\\[^"]|.)*?")/,
  597. comment:
  598. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  599. end: "(?=\")",
  600. name: "string.quoted.double.unclosed.sql",
  601. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  602. {begin: /\\"/,
  603. captures: {0 => {name: "constant.character.escape.php"}},
  604. end: "\\\\\"",
  605. name: "string.quoted.double.sql",
  606. patterns: [{include: "#interpolation"}]},
  607. {begin: /`/,
  608. end: "`",
  609. name: "string.quoted.other.backtick.sql",
  610. patterns: [{include: "#interpolation"}]},
  611. {begin: /'/,
  612. end: "'",
  613. name: "string.quoted.single.sql",
  614. patterns: [{include: "#interpolation"}]},
  615. {match: /\\./, name: "constant.character.escape.php"},
  616. {include: "#interpolation"},
  617. {include: "source.sql"}]},
  618. :"sql-string-single-quoted" =>
  619. {begin:
  620. /'\s*(?=(?<_1>SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b)/,
  621. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  622. contentName: "source.sql.embedded.php",
  623. end: "'",
  624. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  625. name: "string.quoted.single.sql.php",
  626. patterns:
  627. [{match: /#(?<_1>\\'|[^'])*(?='|$\n?)/,
  628. name: "comment.line.number-sign.sql"},
  629. {match: /--(?<_1>\\'|[^'])*(?='|$\n?)/,
  630. name: "comment.line.double-dash.sql"},
  631. {begin: /\\'(?!(?<_1>[^\\']|\\[^'])*\\')(?=(?<_2>\\[^']|.)*?')/,
  632. comment:
  633. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  634. end: "(?=')",
  635. name: "string.quoted.single.unclosed.sql",
  636. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  637. {begin: /`(?=[^`]*?')/,
  638. comment:
  639. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  640. end: "(?=')",
  641. name: "string.quoted.other.backtick.unclosed.sql",
  642. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  643. {begin: /"(?=[^"]*?')/,
  644. comment:
  645. "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
  646. end: "(?=')",
  647. name: "string.quoted.double.unclosed.sql",
  648. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  649. {begin: /\\'/,
  650. captures: {0 => {name: "constant.character.escape.php"}},
  651. end: "\\\\'",
  652. name: "string.quoted.single.sql"},
  653. {match: /\\[\\']/, name: "constant.character.escape.php"},
  654. {include: "source.sql"}]},
  655. :"string-backtick" =>
  656. {begin: /`/,
  657. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  658. end: "`",
  659. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  660. name: "string.interpolated.php",
  661. patterns:
  662. [{match: /\\./, name: "constant.character.escape.php"},
  663. {include: "#interpolation"}]},
  664. :"string-double-quoted" =>
  665. {begin: /"/,
  666. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  667. comment:
  668. "This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes",
  669. contentName: "meta.string-contents.quoted.double.php",
  670. end: "\"",
  671. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  672. name: "string.quoted.double.php",
  673. patterns: [{include: "#interpolation"}]},
  674. :"string-single-quoted" =>
  675. {begin: /'/,
  676. beginCaptures: {0 => {name: "punctuation.definition.string.begin.php"}},
  677. contentName: "meta.string-contents.quoted.single.php",
  678. end: "'",
  679. endCaptures: {0 => {name: "punctuation.definition.string.end.php"}},
  680. name: "string.quoted.single.php",
  681. patterns: [{match: /\\[\\']/, name: "constant.character.escape.php"}]},
  682. strings:
  683. {patterns:
  684. [{include: "#regex-double-quoted"},
  685. {include: "#sql-string-double-quoted"},
  686. {include: "#string-double-quoted"},
  687. {include: "#regex-single-quoted"},
  688. {include: "#sql-string-single-quoted"},
  689. {include: "#string-single-quoted"}]},
  690. support:
  691. {patterns:
  692. [{begin: /(?<_1>array)(?<_2>\()/,
  693. beginCaptures:
  694. {1 => {name: "support.function.construct.php"},
  695. 2 => {name: "punctuation.definition.array.begin.php"}},
  696. end: "\\)",
  697. endCaptures: {0 => {name: "punctuation.definition.array.end.php"}},
  698. name: "meta.array.php",
  699. patterns: [{include: "#language"}]},
  700. {match:
  701. /(?i)\b(?<_1>s(?<_2>huffle|ort)|n(?<_3>ext|at(?<_4>sort|casesort))|c(?<_5>o(?<_6>unt|mpact)|urrent)|in_array|u(?<_7>sort|ksort|asort)|prev|e(?<_8>nd|xtract)|k(?<_9>sort|ey|rsort)|a(?<_10>sort|r(?<_11>sort|ray_(?<_12>s(?<_13>hift|um|plice|earch|lice)|c(?<_14>h(?<_15>unk|ange_key_case)|o(?<_16>unt_values|mbine))|intersect(?<_17>_(?<_18>u(?<_19>key|assoc)|key|assoc))?|diff(?<_20>_(?<_21>u(?<_22>key|assoc)|key|assoc))?|u(?<_23>n(?<_24>shift|ique)|intersect(?<_25>_(?<_26>uassoc|assoc))?|diff(?<_27>_(?<_28>uassoc|assoc))?)|p(?<_29>op|ush|ad|roduct)|values|key(?<_30>s|_exists)|f(?<_31>il(?<_32>ter|l(?<_33>_keys)?)|lip)|walk(?<_34>_recursive)?|r(?<_35>e(?<_36>duce|verse)|and)|m(?<_37>ultisort|erge(?<_38>_recursive)?|ap))))|r(?<_39>sort|eset|ange)|m(?<_40>in|ax))(?=\s*\()/,
  702. name: "support.function.array.php"},
  703. {match: /(?i)\bassert(?<_1>_options)?(?=\s*\()/,
  704. name: "support.function.assert.php"},
  705. {match: /(?i)\bdom_attr_is_id(?=\s*\()/,
  706. name: "support.function.attr.php"},
  707. {match: /(?i)\bbase64_(?<_1>decode|encode)(?=\s*\()/,
  708. name: "support.function.base64.php"},
  709. {match:
  710. /(?i)\b(?<_1>highlight_(?<_2>string|file)|s(?<_3>ys_getloadavg|et_(?<_4>include_path|magic_quotes_runtime)|leep)|c(?<_5>on(?<_6>stant|nection_(?<_7>status|aborted))|all_user_(?<_8>func(?<_9>_array)?|method(?<_10>_array)?))|time_(?<_11>sleep_until|nanosleep)|i(?<_12>s_uploaded_file|n(?<_13>i_(?<_14>set|restore|get(?<_15>_all)?)|et_(?<_16>ntop|pton))|p2long|gnore_user_abort|mport_request_variables)|u(?<_17>sleep|nregister_tick_function)|error_(?<_18>log|get_last)|p(?<_19>hp_strip_whitespace|utenv|arse_ini_file|rint_r)|flush|long2ip|re(?<_20>store_include_path|gister_(?<_21>shutdown_function|tick_function))|get(?<_22>servby(?<_23>name|port)|opt|_(?<_24>c(?<_25>urrent_user|fg_var)|include_path|magic_quotes_(?<_26>gpc|runtime))|protobyn(?<_27>umber|ame)|env)|move_uploaded_file)(?=\s*\()/,
  711. name: "support.function.basic_functions.php"},
  712. {match:
  713. /(?i)\bbc(?<_1>s(?<_2>cale|ub|qrt)|comp|div|pow(?<_3>mod)?|add|m(?<_4>od|ul))(?=\s*\()/,
  714. name: "support.function.bcmath.php"},
  715. {match:
  716. /(?i)\bbirdstep_(?<_1>c(?<_2>o(?<_3>nnect|mmit)|lose)|off_autocommit|exec|f(?<_4>ieldn(?<_5>um|ame)|etch|reeresult)|autocommit|r(?<_6>ollback|esult))(?=\s*\()/,
  717. name: "support.function.birdstep.php"},
  718. {match: /(?i)\bget_browser(?=\s*\()/,
  719. name: "support.function.browscap.php"},
  720. {match:
  721. /(?i)\b(?<_1>s(?<_2>tr(?<_3>nc(?<_4>asecmp|mp)|c(?<_5>asecmp|mp)|len)|et_e(?<_6>rror_handler|xception_handler))|c(?<_7>lass_exists|reate_function)|trigger_error|i(?<_8>s_(?<_9>subclass_of|a)|nterface_exists)|de(?<_10>fine(?<_11>d)?|bug_(?<_12>print_backtrace|backtrace))|zend_version|property_exists|e(?<_13>ach|rror_reporting|xtension_loaded)|func(?<_14>tion_exists|_(?<_15>num_args|get_arg(?<_16>s)?))|leak|restore_e(?<_17>rror_handler|xception_handler)|get_(?<_18>class(?<_19>_(?<_20>vars|methods))?|included_files|de(?<_21>clared_(?<_22>classes|interfaces)|fined_(?<_23>constants|vars|functions))|object_vars|extension_funcs|parent_class|loaded_extensions|resource_type)|method_exists)(?=\s*\()/,
  722. name: "support.function.builtin_functions.php"},
  723. {match:
  724. /(?i)\bbz(?<_1>compress|decompress|open|err(?<_2>str|no|or)|read)(?=\s*\()/,
  725. name: "support.function.bz2.php"},
  726. {match: /(?i)\b(?<_1>jdtounix|unixtojd)(?=\s*\()/,
  727. name: "support.function.cal_unix.php"},
  728. {match:
  729. /(?i)\b(?<_1>cal_(?<_2>to_jd|info|days_in_month|from_jd)|j(?<_3>d(?<_4>to(?<_5>j(?<_6>ulian|ewish)|french|gregorian)|dayofweek|monthname)|uliantojd|ewishtojd)|frenchtojd|gregoriantojd)(?=\s*\()/,
  730. name: "support.function.calendar.php"},
  731. {match:
  732. /(?i)\bdom_characterdata_(?<_1>substring_data|insert_data|delete_data|append_data|replace_data)(?=\s*\()/,
  733. name: "support.function.characterdata.php"},
  734. {match:
  735. /(?i)\bcom_(?<_1>create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)(?=\s*\()/,
  736. name: "support.function.com_com.php"},
  737. {match:
  738. /(?i)\bvariant_(?<_1>s(?<_2>ub|et(?<_3>_type)?)|n(?<_4>ot|eg)|c(?<_5>a(?<_6>st|t)|mp)|i(?<_7>nt|div|mp)|or|d(?<_8>iv|ate_(?<_9>to_timestamp|from_timestamp))|pow|eqv|fix|a(?<_10>nd|dd|bs)|get_type|round|xor|m(?<_11>od|ul))(?=\s*\()/,
  739. name: "support.function.com_variant.php"},
  740. {match: /(?i)\bcrc32(?=\s*\()/, name: "support.function.crc32.php"},
  741. {match: /(?i)\bcrypt(?=\s*\()/, name: "support.function.crypt.php"},
  742. {match:
  743. /(?i)\bctype_(?<_1>space|cntrl|digit|upper|p(?<_2>unct|rint)|lower|al(?<_3>num|pha)|graph|xdigit)(?=\s*\()/,
  744. name: "support.function.ctype.php"},
  745. {match: /(?i)\bconvert_cyr_string(?=\s*\()/,
  746. name: "support.function.cyr_convert.php"},
  747. {match: /(?i)\bstrptime(?=\s*\()/,
  748. name: "support.function.datetime.php"},
  749. {match:
  750. /(?i)\bdba_(?<_1>handlers|sync|nextkey|close|insert|delete|op(?<_2>timize|en)|exists|popen|key_split|f(?<_3>irstkey|etch)|list|replace)(?=\s*\()/,
  751. name: "support.function.dba.php"},
  752. {match:
  753. /(?i)\bdbase_(?<_1>num(?<_2>fields|records)|c(?<_3>lose|reate)|delete_record|open|pack|add_record|get_(?<_4>header_info|record(?<_5>_with_names)?)|replace_record)(?=\s*\()/,
  754. name: "support.function.dbase.php"},
  755. {match:
  756. /(?i)\b(?<_1>scandir|c(?<_2>h(?<_3>dir|root)|losedir)|dir|opendir|re(?<_4>addir|winddir)|g(?<_5>etcwd|lob))(?=\s*\()/,
  757. name: "support.function.dir.php"},
  758. {match: /(?i)\bdl(?=\s*\()/, name: "support.function.dl.php"},
  759. {match:
  760. /(?i)\b(?<_1>dns_(?<_2>check_record|get_(?<_3>record|mx))|gethostby(?<_4>name(?<_5>l)?|addr))(?=\s*\()/,
  761. name: "support.function.dns.php"},
  762. {match:
  763. /(?i)\bdom_document_(?<_1>s(?<_2>chema_validate(?<_3>_file)?|ave(?<_4>_html(?<_5>_file)?|xml)?)|normalize_document|create_(?<_6>c(?<_7>datasection|omment)|text_node|document_fragment|processing_instruction|e(?<_8>ntity_reference|lement(?<_9>_ns)?)|attribute(?<_10>_ns)?)|import_node|validate|load(?<_11>_html(?<_12>_file)?|xml)?|adopt_node|re(?<_13>name_node|laxNG_validate_(?<_14>file|xml))|get_element(?<_15>s_by_tag_name(?<_16>_ns)?|_by_id)|xinclude)(?=\s*\()/,
  764. name: "support.function.document.php"},
  765. {match:
  766. /(?i)\bdom_domconfiguration_(?<_1>set_parameter|can_set_parameter|get_parameter)(?=\s*\()/,
  767. name: "support.function.domconfiguration.php"},
  768. {match: /(?i)\bdom_domerrorhandler_handle_error(?=\s*\()/,
  769. name: "support.function.domerrorhandler.php"},
  770. {match:
  771. /(?i)\bdom_domimplementation_(?<_1>has_feature|create_document(?<_2>_type)?|get_feature)(?=\s*\()/,
  772. name: "support.function.domimplementation.php"},
  773. {match: /(?i)\bdom_domimplementationlist_item(?=\s*\()/,
  774. name: "support.function.domimplementationlist.php"},
  775. {match:
  776. /(?i)\bdom_domimplementationsource_get_domimplementation(?<_1>s)?(?=\s*\()/,
  777. name: "support.function.domimplementationsource.php"},
  778. {match: /(?i)\bdom_domstringlist_item(?=\s*\()/,
  779. name: "support.function.domstringlist.php"},
  780. {match: /(?i)\beaster_da(?<_1>ys|te)(?=\s*\()/,
  781. name: "support.function.easter.php"},
  782. {match:
  783. /(?i)\bdom_element_(?<_1>has_attribute(?<_2>_ns)?|set_(?<_3>id_attribute(?<_4>_n(?<_5>s|ode))?|attribute(?<_6>_n(?<_7>s|ode(?<_8>_ns)?))?)|remove_attribute(?<_9>_n(?<_10>s|ode))?|get_(?<_11>elements_by_tag_name(?<_12>_ns)?|attribute(?<_13>_n(?<_14>s|ode(?<_15>_ns)?))?))(?=\s*\()/,
  784. name: "support.function.element.php"},
  785. {match:
  786. /(?i)\b(?<_1>s(?<_2>hell_exec|ystem)|p(?<_3>assthru|roc_nice)|e(?<_4>scapeshell(?<_5>cmd|arg)|xec))(?=\s*\()/,
  787. name: "support.function.exec.php"},
  788. {match:
  789. /(?i)\bexif_(?<_1>imagetype|t(?<_2>humbnail|agname)|read_data)(?=\s*\()/,
  790. name: "support.function.exif.php"},
  791. {match:
  792. /(?i)\bfdf_(?<_1>header|s(?<_2>et_(?<_3>s(?<_4>tatus|ubmit_form_action)|target_frame|o(?<_5>n_import_javascript|pt)|javascript_action|encoding|v(?<_6>ersion|alue)|f(?<_7>ile|lags)|ap)|ave(?<_8>_string)?)|next_field_name|c(?<_9>lose|reate)|open(?<_10>_string)?|e(?<_11>num_values|rr(?<_12>no|or))|add_(?<_13>template|doc_javascript)|remove_item|get_(?<_14>status|opt|encoding|v(?<_15>ersion|alue)|f(?<_16>ile|lags)|a(?<_17>ttachment|p)))(?=\s*\()/,
  793. name: "support.function.fdf.php"},
  794. {match:
  795. /(?i)\b(?<_1>sys_get_temp_dir|copy|t(?<_2>empnam|mpfile)|u(?<_3>nlink|mask)|p(?<_4>close|open)|f(?<_5>s(?<_6>canf|tat|eek)|nmatch|close|t(?<_7>ell|runcate)|ile(?<_8>_(?<_9>put_contents|get_contents))?|open|p(?<_10>utcsv|assthru)|eof|flush|write|lock|read|get(?<_11>s(?<_12>s)?|c(?<_13>sv)?))|r(?<_14>e(?<_15>name|a(?<_16>dfile|lpath)|wind)|mdir)|get_meta_tags|mkdir)(?=\s*\()/,
  796. name: "support.function.file.php"},
  797. {match:
  798. /(?i)\b(?<_1>stat|c(?<_2>h(?<_3>own|grp|mod)|learstatcache)|is_(?<_4>dir|executable|file|link|writable|readable)|touch|disk_(?<_5>total_space|free_space)|file(?<_6>size|ctime|type|inode|owner|_exists|perms|atime|group|mtime)|l(?<_7>stat|chgrp))(?=\s*\()/,
  799. name: "support.function.filestat.php"},
  800. {match:
  801. /(?i)\bfilter_(?<_1>has_var|input(?<_2>_array)?|var(?<_3>_array)?)(?=\s*\()/,
  802. name: "support.function.filter.php"},
  803. {match:
  804. /(?i)\b(?<_1>sprintf|printf|v(?<_2>sprintf|printf|fprintf)|fprintf)(?=\s*\()/,
  805. name: "support.function.formatted_print.php"},
  806. {match: /(?i)\b(?<_1>pfsockopen|fsockopen)(?=\s*\()/,
  807. name: "support.function.fsock.php"},
  808. {match: /(?i)\bftok(?=\s*\()/, name: "support.function.ftok.php"},
  809. {match:
  810. /(?i)\b(?<_1>image(?<_2>s(?<_3>y|tring(?<_4>up)?|et(?<_5>style|t(?<_6>hickness|ile)|pixel|brush)|avealpha|x)|c(?<_7>har(?<_8>up)?|o(?<_9>nvolution|py(?<_10>res(?<_11>ized|ampled)|merge(?<_12>gray)?)?|lor(?<_13>s(?<_14>total|et|forindex)|closest(?<_15>hwb|alpha)?|transparent|deallocate|exact(?<_16>alpha)?|a(?<_17>t|llocate(?<_18>alpha)?)|resolve(?<_19>alpha)?|match))|reate(?<_20>truecolor|from(?<_21>string|jpeg|png|wbmp|g(?<_22>if|d(?<_23>2(?<_24>part)?)?)|x(?<_25>pm|bm)))?)|2wbmp|t(?<_26>ypes|tf(?<_27>text|bbox)|ruecolortopalette)|i(?<_28>struecolor|nterlace)|d(?<_29>estroy|ashedline)|jpeg|ellipse|p(?<_30>s(?<_31>slantfont|copyfont|text|e(?<_32>ncodefont|xtendfont)|freefont|loadfont|bbox)|ng|olygon|alettecopy)|f(?<_33>t(?<_34>text|bbox)|il(?<_35>ter|l(?<_36>toborder|ed(?<_37>polygon|ellipse|arc|rectangle))?)|ont(?<_38>height|width))|wbmp|a(?<_39>ntialias|lphablending|rc)|l(?<_40>ine|oadfont|ayereffect)|r(?<_41>otate|ectangle)|g(?<_42>if|d(?<_43>2)?|ammacorrect|rab(?<_44>screen|window))|xbm)|jpeg2wbmp|png2wbmp|gd_info)(?=\s*\()/,
  811. name: "support.function.gd.php"},
  812. {match:
  813. /(?i)\b(?<_1>ngettext|textdomain|d(?<_2>ngettext|c(?<_3>ngettext|gettext)|gettext)|gettext|bind(?<_4>textdomain|_textdomain_codeset))(?=\s*\()/,
  814. name: "support.function.gettext.php"},
  815. {match:
  816. /(?i)\bgmp_(?<_1>hamdist|s(?<_2>can(?<_3>1|0)|ign|trval|ub|etbit|qrt(?<_4>rem)?)|c(?<_5>om|lrbit|mp)|ne(?<_6>g|xtprime)|in(?<_7>tval|it|vert)|or|div(?<_8>_(?<_9>q(?<_10>r)?|r)|exact)|jacobi|p(?<_11>o(?<_12>pcount|w(?<_13>m)?)|erfect_square|rob_prime)|fact|legendre|a(?<_14>nd|dd|bs)|random|gcd(?<_15>ext)?|xor|m(?<_16>od|ul))(?=\s*\()/,
  817. name: "support.function.gmp.php"},
  818. {match:
  819. /(?i)\bhash(?<_1>_(?<_2>hmac(?<_3>_file)?|init|update(?<_4>_(?<_5>stream|file))?|fi(?<_6>nal|le)|algos))?(?=\s*\()/,
  820. name: "support.function.hash.php"},
  821. {match: /(?i)\bmd5(?<_1>_file)?(?=\s*\()/,
  822. name: "support.function.hash_md.php"},
  823. {match: /(?i)\bsha1(?<_1>_file)?(?=\s*\()/,
  824. name: "support.function.hash_sha.php"},
  825. {match:
  826. /(?i)\b(?<_1>set(?<_2>cookie|rawcookie)|header(?<_3>s_(?<_4>sent|list))?)(?=\s*\()/,
  827. name: "support.function.head.php"},
  828. {match:
  829. /(?i)\b(?<_1>html(?<_2>specialchars(?<_3>_decode)?|_entity_decode|entities)|get_html_translation_table)(?=\s*\()/,
  830. name: "support.function.html.php"},
  831. {match: /(?i)\bhttp_build_query(?=\s*\()/,
  832. name: "support.function.http.php"},
  833. {match:
  834. /(?i)\bibase_blob_(?<_1>c(?<_2>ancel|lose|reate)|i(?<_3>nfo|mport)|open|echo|add|get)(?=\s*\()/,
  835. name: "support.function.ibase_blobs.php"},
  836. {match:
  837. /(?i)\bibase_(?<_1>set_event_handler|free_event_handler|wait_event)(?=\s*\()/,
  838. name: "support.function.ibase_events.php"},
  839. {match:
  840. /(?i)\bibase_(?<_1>n(?<_2>um_(?<_3>params|fields|rows)|ame_result)|execute|p(?<_4>aram_info|repare)|f(?<_5>ield_info|etch_(?<_6>object|assoc|row)|ree_(?<_7>query|result))|query|affected_rows)(?=\s*\()/,
  841. name: "support.function.ibase_query.php"},
  842. {match:
  843. /(?i)\bibase_(?<_1>serv(?<_2>ice_(?<_3>detach|attach)|er_info)|d(?<_4>elete_user|b_info)|add_user|restore|backup|m(?<_5>odify_user|aintain_db))(?=\s*\()/,
  844. name: "support.function.ibase_service.php"},
  845. {match:
  846. /(?i)\b(?<_1>iconv(?<_2>_(?<_3>s(?<_4>tr(?<_5>pos|len|rpos)|ubstr|et_encoding)|get_encoding|mime_(?<_6>decode(?<_7>_headers)?|encode)))?|ob_iconv_handler)(?=\s*\()/,
  847. name: "support.function.iconv.php"},
  848. {match:
  849. /(?i)\b(?<_1>image_type_to_(?<_2>extension|mime_type)|getimagesize)(?=\s*\()/,
  850. name: "support.function.image.php"},
  851. {match:
  852. /(?i)\b(?<_1>zend_logo_guid|php(?<_2>credits|info|_(?<_3>sapi_name|ini_scanned_files|uname|egg_logo_guid|logo_guid|real_logo_guid)|version))(?=\s*\()/,
  853. name: "support.function.info.php"},
  854. {match:
  855. /(?i)\bibase_(?<_1>c(?<_2>o(?<_3>nnect|mmit(?<_4>_ret)?)|lose)|trans|drop_db|pconnect|err(?<_5>code|msg)|gen_id|rollback(?<_6>_ret)?)(?=\s*\()/,
  856. name: "support.function.interbase.php"},
  857. {match:
  858. /(?i)\bcurl_(?<_1>setopt(?<_2>_array)?|c(?<_3>opy_handle|lose)|init|e(?<_4>rr(?<_5>no|or)|xec)|version|getinfo)(?=\s*\()/,
  859. name: "support.function.interface.php"},
  860. {match: /(?i)\biptc(?<_1>parse|embed)(?=\s*\()/,
  861. name: "support.function.iptc.php"},
  862. {match: /(?i)\bjson_(?<_1>decode|encode)(?=\s*\()/,
  863. name: "support.function.json.php"},
  864. {match: /(?i)\blcg_value(?=\s*\()/, name: "support.function.lcg.php"},
  865. {match:
  866. /(?i)\bldap_(?<_1>s(?<_2>tart_tls|ort|e(?<_3>t_(?<_4>option|

Large files files are truncated, but you can click here to view the full file