python.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?xml version="1.0"?>
  2. <!-- $Id: python.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ -->
  3. <highlight lang="python" case="no">
  4. <authors>
  5. <author name="Andrey Demenev" email="demenev@gmail.com"/>
  6. </authors>
  7. <default innerClass="code" />
  8. <region name="strsingle3" delimClass="quotes" innerClass="string"
  9. start="'''" end="'''" />
  10. <region name="strdouble3" delimClass="quotes" innerClass="string"
  11. start="&quot;&quot;&quot;" end="&quot;&quot;&quot;">
  12. </region>
  13. <region name="strdouble" delimClass="quotes" innerClass="string"
  14. start="&quot;" end="&quot;" >
  15. </region>
  16. <region name="strsingle" delimClass="quotes" innerClass="string"
  17. start="'" end="'" />
  18. <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)" >
  19. <contains all="yes"/>
  20. </region>
  21. <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]" >
  22. <contains all="yes"/>
  23. </region>
  24. <block name="escaped" match="\\." innerClass="special" contained="yes">
  25. <onlyin region="strsingle"/>
  26. <onlyin region="strsingle3"/>
  27. <onlyin region="strdouble"/>
  28. <onlyin region="strdouble3"/>
  29. </block>
  30. <block name="possiblefunction" match="[a-z_]\w*(?=\s*\()" innerClass="identifier" />
  31. <block name="identifier" match="[a-z_]\w*" innerClass="identifier" />
  32. <block name="exponent"
  33. match="((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+)"
  34. innerClass="number" />
  35. <block name="imaginary" match="((\d*\.\d+)|(\d+\.\d*)|(\d+))j" innerClass="number"/>
  36. <block name="float" match="(\d*\.\d+)|(\d+\.\d*)" innerClass="number"/>
  37. <block name="integer" match="\d+l?|\b0l?\b" innerClass="number" />
  38. <block name="hexinteger" match="0[xX][\da-f]+l?" innerClass="number" />
  39. <block name="octinteger" match="0[0-7]+l?" innerClass="number" />
  40. <block name="comment" innerClass="comment"
  41. match="#.+" />
  42. <keywords name="reserved" inherits="identifier" innerClass="reserved" case = "yes">
  43. <keyword match="and"/>
  44. <keyword match="del"/>
  45. <keyword match="for"/>
  46. <keyword match="is"/>
  47. <keyword match="raise"/>
  48. <keyword match="assert"/>
  49. <keyword match="elif"/>
  50. <keyword match="from"/>
  51. <keyword match="lambda"/>
  52. <keyword match="return"/>
  53. <keyword match="break"/>
  54. <keyword match="else"/>
  55. <keyword match="global"/>
  56. <keyword match="not"/>
  57. <keyword match="try"/>
  58. <keyword match="class"/>
  59. <keyword match="except"/>
  60. <keyword match="if"/>
  61. <keyword match="or"/>
  62. <keyword match="while"/>
  63. <keyword match="continue"/>
  64. <keyword match="exec"/>
  65. <keyword match="import"/>
  66. <keyword match="pass"/>
  67. <keyword match="yield"/>
  68. <keyword match="def"/>
  69. <keyword match="finally"/>
  70. <keyword match="in"/>
  71. <keyword match="print"/>
  72. <keyword match="False"/>
  73. <keyword match="True"/>
  74. <keyword match="None"/>
  75. <keyword match="NotImplemented"/>
  76. <keyword match="Ellipsis"/>
  77. <keyword match="Exception" />
  78. <keyword match="SystemExit" />
  79. <keyword match="StopIteration" />
  80. <keyword match="StandardError" />
  81. <keyword match="KeyboardInterrupt" />
  82. <keyword match="ImportError" />
  83. <keyword match="EnvironmentError" />
  84. <keyword match="IOError" />
  85. <keyword match="OSError" />
  86. <keyword match="WindowsError" />
  87. <keyword match="EOFError" />
  88. <keyword match="RuntimeError" />
  89. <keyword match="NotImplementedError" />
  90. <keyword match="NameError" />
  91. <keyword match="UnboundLocalError" />
  92. <keyword match="AttributeError" />
  93. <keyword match="SyntaxError" />
  94. <keyword match="IndentationError" />
  95. <keyword match="TabError" />
  96. <keyword match="TypeError" />
  97. <keyword match="AssertionError" />
  98. <keyword match="LookupError" />
  99. <keyword match="IndexError" />
  100. <keyword match="KeyError" />
  101. <keyword match="ArithmeticError" />
  102. <keyword match="OverflowError" />
  103. <keyword match="ZeroDivisionError" />
  104. <keyword match="FloatingPointError" />
  105. <keyword match="ValueError" />
  106. <keyword match="UnicodeError" />
  107. <keyword match="UnicodeEncodeError" />
  108. <keyword match="UnicodeDecodeError" />
  109. <keyword match="UnicodeTranslateError" />
  110. <keyword match="ReferenceError" />
  111. <keyword match="SystemError" />
  112. <keyword match="MemoryError" />
  113. <keyword match="Warning" />
  114. <keyword match="UserWarning" />
  115. <keyword match="DeprecationWarning" />
  116. <keyword match="PendingDeprecationWarning" />
  117. <keyword match="SyntaxWarning" />
  118. <keyword match="OverflowWarning" />
  119. <keyword match="RuntimeWarning" />
  120. <keyword match="FutureWarning" />
  121. </keywords>
  122. <keywords name="builtin" inherits="possiblefunction"
  123. innerClass="builtin" otherwise="identifier" case = "yes">
  124. <keyword match="__import__"/>
  125. <keyword match="abs"/>
  126. <keyword match="apply"/>
  127. <keyword match="basestring"/>
  128. <keyword match="bool"/>
  129. <keyword match="buffer"/>
  130. <keyword match="callable"/>
  131. <keyword match="chr"/>
  132. <keyword match="classmethod"/>
  133. <keyword match="cmp"/>
  134. <keyword match="coerce"/>
  135. <keyword match="compile"/>
  136. <keyword match="complex"/>
  137. <keyword match="delattr"/>
  138. <keyword match="dict"/>
  139. <keyword match="dir"/>
  140. <keyword match="divmod"/>
  141. <keyword match="enumerate"/>
  142. <keyword match="eval"/>
  143. <keyword match="execfile"/>
  144. <keyword match="file"/>
  145. <keyword match="filter"/>
  146. <keyword match="float"/>
  147. <keyword match="getattr"/>
  148. <keyword match="globals"/>
  149. <keyword match="hasattr"/>
  150. <keyword match="hash"/>
  151. <keyword match="help"/>
  152. <keyword match="hex"/>
  153. <keyword match="id"/>
  154. <keyword match="input"/>
  155. <keyword match="int"/>
  156. <keyword match="intern"/>
  157. <keyword match="isinstance"/>
  158. <keyword match="issubclass"/>
  159. <keyword match="iter"/>
  160. <keyword match="len"/>
  161. <keyword match="list"/>
  162. <keyword match="locals"/>
  163. <keyword match="long"/>
  164. <keyword match="map"/>
  165. <keyword match="max"/>
  166. <keyword match="min"/>
  167. <keyword match="object"/>
  168. <keyword match="oct"/>
  169. <keyword match="open"/>
  170. <keyword match="ord"/>
  171. <keyword match="pow"/>
  172. <keyword match="property"/>
  173. <keyword match="range"/>
  174. <keyword match="raw_input"/>
  175. <keyword match="reduce"/>
  176. <keyword match="reload"/>
  177. <keyword match="repr"/>
  178. <keyword match="round"/>
  179. <keyword match="setattr"/>
  180. <keyword match="slice"/>
  181. <keyword match="staticmethod"/>
  182. <keyword match="sum"/>
  183. <keyword match="super"/>
  184. <keyword match="str"/>
  185. <keyword match="tuple"/>
  186. <keyword match="type"/>
  187. <keyword match="unichr"/>
  188. <keyword match="unicode"/>
  189. <keyword match="vars"/>
  190. <keyword match="xrange"/>
  191. <keyword match="zip"/>
  192. </keywords>
  193. </highlight>