]> git.mxchange.org Git - friendica.git/blob - library/Text_Highlighter/ruby.xml
Merge remote-tracking branch 'upstream/master'
[friendica.git] / library / Text_Highlighter / ruby.xml
1 <?xml version="1.0"?>
2 <!-- $Id: ruby.xml,v 1.1 2007-06-03 02:35:28 ssttoo Exp $ -->
3
4 <highlight lang="ruby" case="no">
5
6   <authors>
7     <author name="Andrey Demenev" email="demenev@gmail.com"/>
8   </authors>
9
10   <comment>
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
15
16 %q(a (nested) string) does not get highlighted correctly
17   </comment>
18
19   <default innerClass="code" />
20
21   <region name="data" start="/^__END__$/m" end="$" delimClass="reserved" innerClass="comment" never-conteined="yes" />
22   
23   <region name="strdouble" delimClass="quotes" innerClass="string" 
24           start="&quot;" end="&quot;" >
25   </region>
26
27   <region name="qstrdouble" delimClass="quotes" innerClass="string" 
28       start="%[Qx]([!&quot;#\$%&amp;'+\-*.\/:;=?@^`|~{&lt;\[(])" end="%b1%"  remember="yes" />
29   
30   <region name="strsingle" delimClass="quotes" innerClass="string" 
31           start="'" end="'" />
32
33   <region name="qstrsingle" delimClass="quotes" innerClass="string" 
34       start="%[wq]([!&quot;#\$%&amp;'+\-*.\/:;=?@^`|~{&lt;\[(])" end="%b1%"  remember="yes" />
35
36   <block name="global" match="\$(\W|\w+)" innerClass="var" />
37
38   <block name="classvar" match="/@@?[_a-z][\d_a-z]*/i" innerClass="var" />
39   
40   <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)" >
41     <contains all="yes"/>
42   </region>
43
44   <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]" >
45     <contains all="yes"/>
46   </region>
47
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"/>
54   </block>
55
56   <block name="identifier" match="[a-z_]\w*" innerClass="identifier" />
57
58   <block name="exponent" 
59          match="((\d+|((\d*\.\d+)|(\d+\.\d*)))[eE][+-]?\d+)" 
60          innerClass="number" />
61
62   <block name="float" match="(\d*\.\d+)|(\d+\.\d*)" innerClass="number"/>
63
64   <block name="hexinteger" match="0[xX][\da-f]+l?" innerClass="number" />
65   
66   <block name="integer" match="\d+l?|\b0l?\b" innerClass="number" />
67
68   <block name="octinteger" match="0[0-7]+l?" innerClass="number" />
69
70
71   <region name="rubydoc" start="/^=begin$/m" end="/^=end$/m" delimClass="comment" innerClass="comment">
72       <contains block="cvstag" />
73   </region>
74   
75   <block name="cvstag" match="\$\w+\s*:.+\$" innerClass="inlinedoc" contained="yes">
76     <onlyin region="comment"/>
77     <onlyin region="rubydoc"/>
78   </block>
79
80   <region name="comment" innerClass="comment" start="#" end="/$/m" delimClass="comment" >
81       <contains block="cvstag" />
82   </region>
83
84   <region name="regexp" delimClass="quotes" innerClass="string" start="\s*\/" end="\/[iomx]*" 
85    neverAfter="(?&lt;!\band|\bor|\bwhile|\buntil|\bunless|\bif|\belsif|\bwhen|[~=!|&amp;(,\[])$">
86   </region>
87   
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" />
137   </keywords>
138
139
140 </highlight>
141