php.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?xml version="1.0"?>
  2. <!-- $Id: php.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ -->
  3. <highlight lang="php">
  4. <authors>
  5. <author name="Andrey Demenev" email ="demenev@gmail.com"/>
  6. </authors>
  7. <default innerClass="code" />
  8. <region name="phpCode" delimClass="inlinetags" innerClass="code"
  9. start="(\&lt;\?(php|=)?)?" end="\?\>" never-contained="yes">
  10. <contains all="yes"/>
  11. </region>
  12. <region name="block" delimClass="brackets" innerClass="code" start="\{" end="\}" contained="yes">
  13. <contains all="yes"/>
  14. </region>
  15. <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)" contained="yes" >
  16. <contains all="yes"/>
  17. </region>
  18. <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]" contained="yes">
  19. <contains all="yes"/>
  20. </region>
  21. <region name="mlcomment" innerClass="comment" start="\/\*" end="\*\/" contained="yes">
  22. <contains block="phpdoc"/>
  23. <contains block="cvstag"/>
  24. </region>
  25. <region name="strdouble" delimClass="quotes" innerClass="string" start="&quot;" end="&quot;" contained="yes">
  26. <contains block="var"/>
  27. </region>
  28. <region name="exec" delimClass="quotes" innerClass="string" start="`" end="`" contained="yes">
  29. <contains block="var"/>
  30. </region>
  31. <region name="heredoc" delimClass="quotes" innerClass="string" start="/\&lt;\&lt;\&lt;[\x20\x09]*(\w+)$/m" end="/^%1%;?$/m" contained="yes" remember="yes">
  32. <contains block="var"/>
  33. </region>
  34. <region name="strsingle" delimClass="quotes" innerClass="string" start="'" end="'" contained="yes"/>
  35. <block name="escaped" match="\\\\|\\&quot;|\\'|\\`" innerClass="special" contained="yes">
  36. <onlyin region="strsingle"/>
  37. <onlyin region="exec"/>
  38. </block>
  39. <block name="descaped" match="\\[\\&quot;'`tnr\$\{]" innerClass="special" contained="yes">
  40. <onlyin region="strdouble"/>
  41. <onlyin region="heredoc"/>
  42. </block>
  43. <region name="comment" start="(#|\/\/)" end="/$|(?=\?\>)/m" innerClass="comment" contained="yes">
  44. <contains block="cvstag"/>
  45. </region>
  46. <block name="identifier" match="[a-z_]\w*" innerClass="identifier" contained="yes"/>
  47. <block name="typecast" match="\((array|int|integer|string|bool|boolean|object|float|double)\)" innerClass="reserved" contained="yes"/>
  48. <block name="curlyvar" match="\{\$[a-z_].*\}" innerClass="var" contained="yes">
  49. <onlyin region="strdouble"/>
  50. <onlyin region="heredoc"/>
  51. <onlyin region="exec"/>
  52. </block>
  53. <region name="codeescape" delimClass="inlinetags" innerClass="default" end="\&lt;\?(php|=)?" start="\?\>" contained="yes">
  54. <onlyin region="block"/>
  55. </region>
  56. <block name="hexinteger" match="0[xX][\da-f]+" innerClass="number" contained="yes"/>
  57. <block name="var" match="\$[a-z_]\w*" innerClass="var" contained="yes"/>
  58. <block name="integer" match="\d\d*|\b0\b" innerClass="number" contained="yes"/>
  59. <block name="octinteger" match="0[0-7]+" innerClass="number" contained="yes"/>
  60. <block name="float" match="(\d*\.\d+)|(\d+\.\d*)" innerClass="number" contained="yes"/>
  61. <block name="exponent"
  62. match="((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+)"
  63. innerClass="number" contained="yes"/>
  64. <block name="phpdoc" match="\s@\w+\s" innerClass="inlinedoc" contained="yes">
  65. <onlyin region="mlcomment"/>
  66. <onlyin region="comment"/>
  67. </block>
  68. <block name="url" match="((https?|ftp):\/\/[\w\?\.\-\&amp;=\/%+]+)|(^|[\s,!?])www\.\w+\.\w+[\w\?\.\&amp;=\/%+]*" innerClass="url" contained="yes">
  69. <onlyin region="mlcomment"/>
  70. <onlyin region="comment"/>
  71. </block>
  72. <block name="email" match="\w+[\.\w\-]+@(\w+[\.\w\-])+" innerClass="url" contained="yes">
  73. <onlyin region="mlcomment"/>
  74. <onlyin region="comment"/>
  75. </block>
  76. <block name="note" match="\bnote:" innerClass="inlinedoc" contained="yes">
  77. <onlyin region="mlcomment"/>
  78. <onlyin region="comment"/>
  79. </block>
  80. <block name="cvstag" match="\$\w+\s*:.*\$" innerClass="inlinedoc" contained="yes">
  81. <onlyin region="mlcomment"/>
  82. <onlyin region="comment"/>
  83. </block>
  84. <keywords name="constants" inherits="identifier" innerClass="reserved" case = "yes">
  85. <keyword match="DIRECTORY_SEPARATOR"/>
  86. <keyword match="PATH_SEPARATOR"/>
  87. </keywords>
  88. <keywords name="reserved" inherits="identifier" innerClass="reserved">
  89. <keyword match="echo"/>
  90. <keyword match="foreach"/>
  91. <keyword match="else"/>
  92. <keyword match="if"/>
  93. <keyword match="elseif"/>
  94. <keyword match="for"/>
  95. <keyword match="as"/>
  96. <keyword match="while"/>
  97. <keyword match="foreach"/>
  98. <keyword match="break"/>
  99. <keyword match="continue"/>
  100. <keyword match="class"/>
  101. <keyword match="const"/>
  102. <keyword match="declare"/>
  103. <keyword match="switch"/>
  104. <keyword match="case"/>
  105. <keyword match="endfor"/>
  106. <keyword match="endswitch"/>
  107. <keyword match="endforeach"/>
  108. <keyword match="endswitch"/>
  109. <keyword match="endif"/>
  110. <keyword match="array"/>
  111. <keyword match="default"/>
  112. <keyword match="do"/>
  113. <keyword match="enddeclare"/>
  114. <keyword match="eval"/>
  115. <keyword match="exit"/>
  116. <keyword match="die"/>
  117. <keyword match="extends"/>
  118. <keyword match="function"/>
  119. <keyword match="global"/>
  120. <keyword match="include"/>
  121. <keyword match="include_once"/>
  122. <keyword match="require"/>
  123. <keyword match="require_once"/>
  124. <keyword match="isset"/>
  125. <keyword match="empty"/>
  126. <keyword match="list"/>
  127. <keyword match="new"/>
  128. <keyword match="static"/>
  129. <keyword match="unset"/>
  130. <keyword match="var"/>
  131. <keyword match="return"/>
  132. <keyword match="try"/>
  133. <keyword match="catch"/>
  134. <keyword match="final"/>
  135. <keyword match="throw"/>
  136. <keyword match="public"/>
  137. <keyword match="private"/>
  138. <keyword match="protected"/>
  139. <keyword match="abstract"/>
  140. <keyword match="interface"/>
  141. <keyword match="implements"/>
  142. <keyword match="const"/>
  143. <keyword match="define"/>
  144. <keyword match="__FILE__"/>
  145. <keyword match="__LINE__"/>
  146. <keyword match="__CLASS__"/>
  147. <keyword match="__METHOD__"/>
  148. <keyword match="__FUNCTION__"/>
  149. <keyword match="NULL"/>
  150. <keyword match="true"/>
  151. <keyword match="false"/>
  152. <keyword match="and"/>
  153. <keyword match="or"/>
  154. <keyword match="xor"/>
  155. </keywords>
  156. </highlight>