2 <!-- $Id: ruby.xml,v 1.1 2007-06-03 02:35:28 ssttoo Exp $ -->
4 <highlight lang="ruby" case="no">
7 <author name="Andrey Demenev" email="demenev@gmail.com"/>
11 FIXME: While this construction : s.split /z/i
12 is valid, regular expression is not recognized as such
13 (/ folowing an identifier or number is not recognized as
14 start of RE), making highlighting improper
16 %q(a (nested) string) does not get highlighted correctly
19 <default innerClass="code" />
21 <region name="data" start="/^__END__$/m" end="$" delimClass="reserved" innerClass="comment" never-conteined="yes" />
23 <region name="strdouble" delimClass="quotes" innerClass="string"
24 start=""" end=""" >
27 <region name="qstrdouble" delimClass="quotes" innerClass="string"
28 start="%[Qx]([!"#\$%&'+\-*.\/:;=?@^`|~{<\[(])" end="%b1%" remember="yes" />
30 <region name="strsingle" delimClass="quotes" innerClass="string"
33 <region name="qstrsingle" delimClass="quotes" innerClass="string"
34 start="%[wq]([!"#\$%&'+\-*.\/:;=?@^`|~{<\[(])" end="%b1%" remember="yes" />
36 <block name="global" match="\$(\W|\w+)" innerClass="var" />
38 <block name="classvar" match="/@@?[_a-z][\d_a-z]*/i" innerClass="var" />
40 <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)" >
44 <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]" >
48 <block name="escaped" match="\\." innerClass="special" contained="yes">
49 <onlyin region="qstrsingle"/>
50 <onlyin region="strsingle"/>
51 <onlyin region="qstrdouble"/>
52 <onlyin region="strdouble"/>
53 <onlyin region="regexp"/>
56 <block name="identifier" match="[a-z_]\w*" innerClass="identifier" />
58 <block name="exponent"
59 match="((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+)"
60 innerClass="number" />
62 <block name="float" match="(\d*\.\d+)|(\d+\.\d*)" innerClass="number"/>
64 <block name="hexinteger" match="0[xX][\da-f]+l?" innerClass="number" />
66 <block name="integer" match="\d+l?|\b0l?\b" innerClass="number" />
68 <block name="octinteger" match="0[0-7]+l?" innerClass="number" />
71 <region name="rubydoc" start="/^=begin$/m" end="/^=end$/m" delimClass="comment" innerClass="comment">
72 <contains block="cvstag" />
75 <block name="cvstag" match="\$\w+\s*:.+\$" innerClass="inlinedoc" contained="yes">
76 <onlyin region="comment"/>
77 <onlyin region="rubydoc"/>
80 <region name="comment" innerClass="comment" start="#" end="/$/m" delimClass="comment" >
81 <contains block="cvstag" />
84 <region name="regexp" delimClass="quotes" innerClass="string" start="\s*\/" end="\/[iomx]*"
85 neverAfter="(?<!\band|\bor|\bwhile|\buntil|\bunless|\bif|\belsif|\bwhen|[~=!|&(,\[])$">
88 <keywords name="reserved" inherits="identifier" innerClass="reserved" case = "yes">
89 <keyword match="__FILE__" />
90 <keyword match="require" />
91 <keyword match="and" />
92 <keyword match="def" />
93 <keyword match="end" />
94 <keyword match="in" />
95 <keyword match="or" />
96 <keyword match="self" />
97 <keyword match="unless" />
98 <keyword match="__LINE__" />
99 <keyword match="begin" />
100 <keyword match="defined?" />
101 <keyword match="ensure" />
102 <keyword match="module" />
103 <keyword match="redo" />
104 <keyword match="super" />
105 <keyword match="until" />
106 <keyword match="BEGIN" />
107 <keyword match="break" />
108 <keyword match="do" />
109 <keyword match="false" />
110 <keyword match="next" />
111 <keyword match="rescue" />
112 <keyword match="then" />
113 <keyword match="when" />
114 <keyword match="END" />
115 <keyword match="case" />
116 <keyword match="else" />
117 <keyword match="for" />
118 <keyword match="nil" />
119 <keyword match="retry" />
120 <keyword match="true" />
121 <keyword match="while" />
122 <keyword match="alias" />
123 <keyword match="module_function" />
124 <keyword match="private" />
125 <keyword match="public" />
126 <keyword match="protected" />
127 <keyword match="attr_reader" />
128 <keyword match="attr_writer" />
129 <keyword match="attr_accessor" />
130 <keyword match="class" />
131 <keyword match="elsif" />
132 <keyword match="if" />
133 <keyword match="not" />
134 <keyword match="return" />
135 <keyword match="undef" />
136 <keyword match="yield" />