ruby.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0"?>
  2. <!-- $Id: ruby.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ -->
  3. <highlight lang="ruby" case="no">
  4. <authors>
  5. <author name="Andrey Demenev" email="demenev@gmail.com"/>
  6. </authors>
  7. <comment>
  8. FIXME: While this construction : s.split /z/i
  9. is valid, regular expression is not recognized as such
  10. (/ folowing an identifier or number is not recognized as
  11. start of RE), making highlighting improper
  12. %q(a (nested) string) does not get highlighted correctly
  13. </comment>
  14. <default innerClass="code" />
  15. <region name="data" start="/^__END__$/m" end="$" delimClass="reserved" innerClass="comment" never-conteined="yes" />
  16. <region name="strdouble" delimClass="quotes" innerClass="string"
  17. start="&quot;" end="&quot;" >
  18. </region>
  19. <region name="qstrdouble" delimClass="quotes" innerClass="string"
  20. start="%[Qx]([!&quot;#\$%&amp;'+\-*.\/:;=?@^`|~{&lt;\[(])" end="%b1%" remember="yes" />
  21. <region name="strsingle" delimClass="quotes" innerClass="string"
  22. start="'" end="'" />
  23. <region name="qstrsingle" delimClass="quotes" innerClass="string"
  24. start="%[wq]([!&quot;#\$%&amp;'+\-*.\/:;=?@^`|~{&lt;\[(])" end="%b1%" remember="yes" />
  25. <block name="global" match="\$(\W|\w+)" innerClass="var" />
  26. <block name="classvar" match="/@@?[_a-z][\d_a-z]*/i" innerClass="var" />
  27. <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)" >
  28. <contains all="yes"/>
  29. </region>
  30. <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]" >
  31. <contains all="yes"/>
  32. </region>
  33. <block name="escaped" match="\\." innerClass="special" contained="yes">
  34. <onlyin region="qstrsingle"/>
  35. <onlyin region="strsingle"/>
  36. <onlyin region="qstrdouble"/>
  37. <onlyin region="strdouble"/>
  38. <onlyin region="regexp"/>
  39. </block>
  40. <block name="identifier" match="[a-z_]\w*" innerClass="identifier" />
  41. <block name="exponent"
  42. match="((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+)"
  43. innerClass="number" />
  44. <block name="float" match="(\d*\.\d+)|(\d+\.\d*)" innerClass="number"/>
  45. <block name="hexinteger" match="0[xX][\da-f]+l?" innerClass="number" />
  46. <block name="integer" match="\d+l?|\b0l?\b" innerClass="number" />
  47. <block name="octinteger" match="0[0-7]+l?" innerClass="number" />
  48. <region name="rubydoc" start="/^=begin$/m" end="/^=end$/m" delimClass="comment" innerClass="comment">
  49. <contains block="cvstag" />
  50. </region>
  51. <block name="cvstag" match="\$\w+\s*:.+\$" innerClass="inlinedoc" contained="yes">
  52. <onlyin region="comment"/>
  53. <onlyin region="rubydoc"/>
  54. </block>
  55. <region name="comment" innerClass="comment" start="#" end="/$/m" delimClass="comment" >
  56. <contains block="cvstag" />
  57. </region>
  58. <region name="regexp" delimClass="quotes" innerClass="string" start="\s*\/" end="\/[iomx]*"
  59. neverAfter="(?&lt;!\band|\bor|\bwhile|\buntil|\bunless|\bif|\belsif|\bwhen|[~=!|&amp;(,\[])$">
  60. </region>
  61. <keywords name="reserved" inherits="identifier" innerClass="reserved" case = "yes">
  62. <keyword match="__FILE__" />
  63. <keyword match="require" />
  64. <keyword match="and" />
  65. <keyword match="def" />
  66. <keyword match="end" />
  67. <keyword match="in" />
  68. <keyword match="or" />
  69. <keyword match="self" />
  70. <keyword match="unless" />
  71. <keyword match="__LINE__" />
  72. <keyword match="begin" />
  73. <keyword match="defined?" />
  74. <keyword match="ensure" />
  75. <keyword match="module" />
  76. <keyword match="redo" />
  77. <keyword match="super" />
  78. <keyword match="until" />
  79. <keyword match="BEGIN" />
  80. <keyword match="break" />
  81. <keyword match="do" />
  82. <keyword match="false" />
  83. <keyword match="next" />
  84. <keyword match="rescue" />
  85. <keyword match="then" />
  86. <keyword match="when" />
  87. <keyword match="END" />
  88. <keyword match="case" />
  89. <keyword match="else" />
  90. <keyword match="for" />
  91. <keyword match="nil" />
  92. <keyword match="retry" />
  93. <keyword match="true" />
  94. <keyword match="while" />
  95. <keyword match="alias" />
  96. <keyword match="module_function" />
  97. <keyword match="private" />
  98. <keyword match="public" />
  99. <keyword match="protected" />
  100. <keyword match="attr_reader" />
  101. <keyword match="attr_writer" />
  102. <keyword match="attr_accessor" />
  103. <keyword match="class" />
  104. <keyword match="elsif" />
  105. <keyword match="if" />
  106. <keyword match="not" />
  107. <keyword match="return" />
  108. <keyword match="undef" />
  109. <keyword match="yield" />
  110. </keywords>
  111. </highlight>