Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.6 KiB

  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>