rubybuntu-gedit 11.09.30 → 11.10.18
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/bin/rubybuntu-gedit +20 -16
- data/bin/rubybuntu-gedit~ +148 -0
- data/data/language-specs/ruby.lang +55 -49
- data/data/language-specs/ruby.lang-extras/brackets.rb +15 -3
- data/data/language-specs/ruby.lang-extras/brackets.rb~ +72 -0
- data/data/language-specs/ruby.lang~ +1449 -0
- data/data/styles/rubybuntu1.xml +0 -7
- data/data/styles/rubybuntu2.xml +120 -0
- data/rubybuntu-gedit.gemspec +1 -1
- metadata +10 -5
@@ -0,0 +1,72 @@
|
|
1
|
+
# hashs
|
2
|
+
{}
|
3
|
+
{}
|
4
|
+
{ hey{} }
|
5
|
+
a={}
|
6
|
+
a= {}
|
7
|
+
a ?{} :{}
|
8
|
+
!{}
|
9
|
+
|
10
|
+
{{} => {}}
|
11
|
+
|
12
|
+
1 if {{} => {}}
|
13
|
+
1 rescue{}
|
14
|
+
|
15
|
+
1 if[]
|
16
|
+
1 rescue []
|
17
|
+
|
18
|
+
# arrays
|
19
|
+
[]
|
20
|
+
[]
|
21
|
+
[]
|
22
|
+
a=[]
|
23
|
+
a= []
|
24
|
+
|
25
|
+
# procs/square brackets
|
26
|
+
a{}
|
27
|
+
☆{}
|
28
|
+
A{}
|
29
|
+
->{}
|
30
|
+
->(x){}
|
31
|
+
a?{}
|
32
|
+
a!{}
|
33
|
+
|
34
|
+
a {}
|
35
|
+
☆ {}
|
36
|
+
A {}
|
37
|
+
-> {}
|
38
|
+
-> (x) {}
|
39
|
+
a? {}
|
40
|
+
a! {}
|
41
|
+
|
42
|
+
a[]
|
43
|
+
a []
|
44
|
+
a[b]
|
45
|
+
a [b]
|
46
|
+
a[[a]]
|
47
|
+
a [[b]]
|
48
|
+
☆[]
|
49
|
+
☆ []
|
50
|
+
A[]
|
51
|
+
A []
|
52
|
+
a?[]
|
53
|
+
a? []
|
54
|
+
a![]
|
55
|
+
a! []
|
56
|
+
a[][]
|
57
|
+
b [] []
|
58
|
+
|
59
|
+
a(){}
|
60
|
+
a () {}
|
61
|
+
a()[]
|
62
|
+
a () []
|
63
|
+
a[]{}
|
64
|
+
a [] {}
|
65
|
+
a[b]{}
|
66
|
+
a [b] {{}}
|
67
|
+
a{}[]
|
68
|
+
a {} [[]]
|
69
|
+
|
70
|
+
->{}
|
71
|
+
a -> () {}
|
72
|
+
|
@@ -0,0 +1,1449 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
|
4
|
+
Author: Archit Baweja <bighead@users.sourceforge.net>
|
5
|
+
Copyright (C) 2004 Archit Baweja <bighead@users.sourceforge.net>
|
6
|
+
Copyright (C) 2005 Michael Witrant <mike@lepton.fr>
|
7
|
+
Copyright (C) 2006 Gabriel Bauman <gbauman@gmail.com>
|
8
|
+
Copyright (C) 2009 Alexandre da Silva <lexrupy@gmail.com>
|
9
|
+
Copyright (C) 2011 Jan Lelis <mail@janlelis.de>
|
10
|
+
|
11
|
+
This library is free software; you can redistribute it and/or modify
|
12
|
+
it under the terms of the GNU General Public License as published by
|
13
|
+
the Free Software Foundation; either version 2 of the License, or
|
14
|
+
(at your option) any later version.
|
15
|
+
|
16
|
+
This program is distributed in the hope that it will be useful,
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
+
GNU General Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU General Public License
|
22
|
+
along with this program; if not, write to the Free Software
|
23
|
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
24
|
+
|
25
|
+
-->
|
26
|
+
<language id="ruby" _name="Ruby" version="2.0" _section="Scripts">
|
27
|
+
<metadata>
|
28
|
+
<property name="mimetypes">application/x-ruby;text/x-ruby</property>
|
29
|
+
<property name="globs">*.rb;*.gemspec;*.rake;*.ru;*thor;Rakefile;Capfile;Gemfile;Thorfile;.irbrc</property>
|
30
|
+
<property name="line-comment-start">#</property>
|
31
|
+
<property name="block-comment-start">=begin</property>
|
32
|
+
<property name="block-comment-end">=end</property>
|
33
|
+
</metadata>
|
34
|
+
|
35
|
+
<styles>
|
36
|
+
<style id="method" _name="Method or local variable" map-to="def:identifier"/>
|
37
|
+
<style id="important-method" _name="Important methods" map-to="def:builtin"/>
|
38
|
+
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
|
39
|
+
<style id="syntax-char" _name="Syntactical characters" map-to="ruby:keyword"/>
|
40
|
+
<style id="operator" _name="Operators" map-to="def:operator"/>
|
41
|
+
<style id="special-value" _name="nil, false, true" map-to="def:boolean"/>
|
42
|
+
<style id="self" _name="self" map-to="ruby:special-value"/>
|
43
|
+
<style id="true" _name="true" map-to="ruby:special-value"/>
|
44
|
+
<style id="false" _name="false" map-to="ruby:special-value"/>
|
45
|
+
<style id="nil" _name="nil" map-to="ruby:special-value"/>
|
46
|
+
<style id="collection" _name="Collections (Arrays, Hashes)" map-to="ruby:syntax-char"/>
|
47
|
+
<style id="function" _name="Function definition" map-to="def:function"/>
|
48
|
+
|
49
|
+
<style id="constant" _name="Constant" map-to="def:constant"/>
|
50
|
+
<style id="important-constant" _name="Important constant" map-to="def:special-constant"/>
|
51
|
+
|
52
|
+
<style id="instance-variable" _name="Instance variable" map-to="def:identifier"/>
|
53
|
+
<style id="class-variable" _name="Class variable" map-to="ruby:instance-variable"/>
|
54
|
+
<style id="global-variable" _name="Global variable" map-to="def:identifier"/>
|
55
|
+
<style id="special-variable" _name="Special variable" map-to="ruby:global-variable"/>
|
56
|
+
|
57
|
+
<style id="comment" _name="Comment" map-to="def:comment"/>
|
58
|
+
<style id="encoding-comment" _name="Magic Comment" map-to="def:shebang"/>
|
59
|
+
<style id="comment-tag" _name="YARD comment tag" map-to="def:doc-comment"/>
|
60
|
+
<!--style id="comment-tag-value" _name="YARD comment tag value" map-to="def:doc-comment-element"/-->
|
61
|
+
|
62
|
+
<style id="string" _name="String" map-to="def:string"/>
|
63
|
+
<style id="string-delimiter" _name="String delimiter" map-to="ruby:string"/>
|
64
|
+
<style id="character" _name="Character in question mark notation" map-to="def:character"/>
|
65
|
+
<style id="special-char" _name="Escaped Character" map-to="def:special-char"/>
|
66
|
+
|
67
|
+
<style id="system" _name="System command" map-to="ruby:string"/>
|
68
|
+
<style id="system-delimiter" _name="System command delimiter" map-to="ruby:system"/>
|
69
|
+
|
70
|
+
<style id="symbol" _name="Symbol" map-to="ruby:function"/>
|
71
|
+
<style id="symbol-delimiter" _name="Symbol delimiter" map-to="ruby:symbol"/>
|
72
|
+
|
73
|
+
<style id="regex" _name="Regular expression" map-to="ruby:string"/>
|
74
|
+
<style id="regex-delimiter" _name="Regular expression delimiter" map-to="ruby:regex"/>
|
75
|
+
<style id="regex-options" _name="Regular expression options" map-to="ruby:regex-delimiter"/>
|
76
|
+
|
77
|
+
<style id="float" _name="Floating point number" map-to="def:floating-point"/>
|
78
|
+
<style id="integer" _name="Integer number" map-to="def:decimal"/>
|
79
|
+
<style id="base-n-integer" _name="Base-N number" map-to="def:base-n-integer"/>
|
80
|
+
|
81
|
+
<style id="error" _name="Erroneous syntax" map-to="def:error"/>
|
82
|
+
</styles>
|
83
|
+
|
84
|
+
<definitions>
|
85
|
+
|
86
|
+
<context id="special-chars" style-ref="special-char">
|
87
|
+
<match>\\((0-7){3}|(x[a-fA-F0-9]{2})|(c\S)|([CM]-\S)|(M-C-\S)|.)</match>
|
88
|
+
</context>
|
89
|
+
|
90
|
+
<context id="multiline-comment" style-ref="comment" class-disabled="no-spell-check">
|
91
|
+
<start>^=begin</start>
|
92
|
+
<end>^=end</end>
|
93
|
+
<include>
|
94
|
+
<context ref="def:in-comment"/>
|
95
|
+
<context ref="in-comment-docs"/>
|
96
|
+
</include>
|
97
|
+
</context>
|
98
|
+
|
99
|
+
<context id="shell-like-comment" style-ref="comment" end-at-line-end="true"
|
100
|
+
class-disabled="no-spell-check">
|
101
|
+
<start>#</start>
|
102
|
+
<include>
|
103
|
+
<context ref="def:in-comment"/>
|
104
|
+
<context ref="in-comment-docs"/>
|
105
|
+
</include>
|
106
|
+
</context>
|
107
|
+
|
108
|
+
<context id="in-comment-docs" style-ref="comment-tag" extend-parent="false">
|
109
|
+
<match>@\w+(\s*\[.*?\])?</match>
|
110
|
+
</context>
|
111
|
+
|
112
|
+
<context id="encoding-comment" style-ref="encoding-comment" first-line-only="true"
|
113
|
+
class="no-spell-check">
|
114
|
+
<match case-sensitive="false">\s*#.*coding.*</match>
|
115
|
+
</context>
|
116
|
+
|
117
|
+
<define-regex id="alnum">[^&><!?"'`@$%/()=\\{\[\]}*+~#|;,:.\-\^\s]</define-regex>
|
118
|
+
<define-regex id="no_method_prefix">(?<![\w\.\:])</define-regex>
|
119
|
+
<define-regex id="no_method_suffix">(?!(\%{alnum}|[?!]))</define-regex>
|
120
|
+
<define-regex id="keywords" extended="true"><!-- TODO also change at array+hash stuff -->
|
121
|
+
BEGIN | END | alias | begin | break | case | class | do | else | elsif |
|
122
|
+
end | ensure | for | if | in | module | next | redo | rescue | retry |
|
123
|
+
return | super | then | undef | unless | until | when | while | yield
|
124
|
+
</define-regex>
|
125
|
+
|
126
|
+
<context id="keywords" style-ref="keyword">
|
127
|
+
<match>\%{no_method_prefix}\%{keywords}\%{no_method_suffix}</match>
|
128
|
+
</context>
|
129
|
+
|
130
|
+
<context id="important-methods" style-ref="important-method">
|
131
|
+
<suffix></suffix>
|
132
|
+
<keyword>warn\%{no_method_suffix}</keyword>
|
133
|
+
<keyword>untrusted\?</keyword>
|
134
|
+
<keyword>untrust\%{no_method_suffix}</keyword>
|
135
|
+
<keyword>untrace_var\%{no_method_suffix}</keyword>
|
136
|
+
<keyword>untaint\%{no_method_suffix}</keyword>
|
137
|
+
<keyword>undef_method\%{no_method_suffix}</keyword>
|
138
|
+
<keyword>trust\%{no_method_suffix}</keyword>
|
139
|
+
<keyword>trap\%{no_method_suffix}</keyword>
|
140
|
+
<keyword>trace_var\%{no_method_suffix}</keyword>
|
141
|
+
<keyword>to_s\%{no_method_suffix}</keyword>
|
142
|
+
<keyword>to_enum\%{no_method_suffix}</keyword>
|
143
|
+
<keyword>throw\%{no_method_suffix}</keyword>
|
144
|
+
<keyword>test\%{no_method_suffix}</keyword>
|
145
|
+
<keyword>tap\%{no_method_suffix}</keyword>
|
146
|
+
<keyword>tainted\?</keyword>
|
147
|
+
<keyword>taint\%{no_method_suffix}</keyword>
|
148
|
+
<keyword>system\%{no_method_suffix}</keyword>
|
149
|
+
<keyword>syscall\%{no_method_suffix}</keyword>
|
150
|
+
<keyword>superclass\%{no_method_suffix}</keyword>
|
151
|
+
<keyword>srand\%{no_method_suffix}</keyword>
|
152
|
+
<keyword>sprintf\%{no_method_suffix}</keyword>
|
153
|
+
<keyword>spawn\%{no_method_suffix}</keyword>
|
154
|
+
<keyword>sleep\%{no_method_suffix}</keyword>
|
155
|
+
<keyword>singleton_methods\%{no_method_suffix}</keyword>
|
156
|
+
<keyword>singleton_method_undefined\%{no_method_suffix}</keyword>
|
157
|
+
<keyword>singleton_method_removed\%{no_method_suffix}</keyword>
|
158
|
+
<keyword>singleton_method_added\%{no_method_suffix}</keyword>
|
159
|
+
<keyword>singleton_class\%{no_method_suffix}</keyword>
|
160
|
+
<keyword>set_trace_func\%{no_method_suffix}</keyword>
|
161
|
+
<keyword>send\%{no_method_suffix}</keyword>
|
162
|
+
<keyword>select\%{no_method_suffix}</keyword>
|
163
|
+
<keyword>respond_to_missing\?</keyword>
|
164
|
+
<keyword>respond_to\?</keyword>
|
165
|
+
<keyword>require_relative\%{no_method_suffix}</keyword>
|
166
|
+
<keyword>require\%{no_method_suffix}</keyword>
|
167
|
+
<keyword>remove_method\%{no_method_suffix}</keyword>
|
168
|
+
<keyword>remove_instance_variable\%{no_method_suffix}</keyword>
|
169
|
+
<keyword>remove_const\%{no_method_suffix}</keyword>
|
170
|
+
<keyword>remove_class_variable\%{no_method_suffix}</keyword>
|
171
|
+
<keyword>readlines\%{no_method_suffix}</keyword>
|
172
|
+
<keyword>readline\%{no_method_suffix}</keyword>
|
173
|
+
<keyword>rand\%{no_method_suffix}</keyword>
|
174
|
+
<keyword>raise\%{no_method_suffix}</keyword>
|
175
|
+
<keyword>puts\%{no_method_suffix}</keyword>
|
176
|
+
<keyword>putc\%{no_method_suffix}</keyword>
|
177
|
+
<keyword>public_send\%{no_method_suffix}</keyword>
|
178
|
+
<keyword>public_methods\%{no_method_suffix}</keyword>
|
179
|
+
<keyword>public_method_defined\?</keyword>
|
180
|
+
<keyword>public_method\%{no_method_suffix}</keyword>
|
181
|
+
<keyword>public_instance_methods\%{no_method_suffix}</keyword>
|
182
|
+
<keyword>public_instance_method\%{no_method_suffix}</keyword>
|
183
|
+
<keyword>public_constant\%{no_method_suffix}</keyword>
|
184
|
+
<keyword>public_class_method\%{no_method_suffix}</keyword>
|
185
|
+
<keyword>public\%{no_method_suffix}</keyword>
|
186
|
+
<keyword>protected_methods\%{no_method_suffix}</keyword>
|
187
|
+
<keyword>protected_method_defined\?</keyword>
|
188
|
+
<keyword>protected_instance_methods\%{no_method_suffix}</keyword>
|
189
|
+
<keyword>protected\%{no_method_suffix}</keyword>
|
190
|
+
<keyword>proc\%{no_method_suffix}</keyword>
|
191
|
+
<keyword>private_methods\%{no_method_suffix}</keyword>
|
192
|
+
<keyword>private_method_defined\?</keyword>
|
193
|
+
<keyword>private_instance_methods\%{no_method_suffix}</keyword>
|
194
|
+
<keyword>private_constant\%{no_method_suffix}</keyword>
|
195
|
+
<keyword>private_class_method\%{no_method_suffix}</keyword>
|
196
|
+
<keyword>private\%{no_method_suffix}</keyword>
|
197
|
+
<keyword>printf\%{no_method_suffix}</keyword>
|
198
|
+
<keyword>print\%{no_method_suffix}</keyword>
|
199
|
+
<keyword>p\%{no_method_suffix}</keyword>
|
200
|
+
<keyword>open\%{no_method_suffix}</keyword>
|
201
|
+
<keyword>object_id\%{no_method_suffix}</keyword>
|
202
|
+
<keyword>nil\?</keyword>
|
203
|
+
<keyword>new\%{no_method_suffix}</keyword>
|
204
|
+
<keyword>nesting\%{no_method_suffix}</keyword>
|
205
|
+
<keyword>name\%{no_method_suffix}</keyword>
|
206
|
+
<keyword>module_function\%{no_method_suffix}</keyword>
|
207
|
+
<keyword>module_exec\%{no_method_suffix}</keyword>
|
208
|
+
<keyword>module_eval\%{no_method_suffix}</keyword>
|
209
|
+
<keyword>methods\%{no_method_suffix}</keyword>
|
210
|
+
<keyword>method_undefined\%{no_method_suffix}</keyword>
|
211
|
+
<keyword>method_removed\%{no_method_suffix}</keyword>
|
212
|
+
<keyword>method_missing\%{no_method_suffix}</keyword>
|
213
|
+
<keyword>method_defined\?</keyword>
|
214
|
+
<keyword>method_added\%{no_method_suffix}</keyword>
|
215
|
+
<keyword>method\%{no_method_suffix}</keyword>
|
216
|
+
<keyword>loop\%{no_method_suffix}</keyword>
|
217
|
+
<keyword>local_variables\%{no_method_suffix}</keyword>
|
218
|
+
<keyword>load\%{no_method_suffix}</keyword>
|
219
|
+
<keyword>lambda\%{no_method_suffix}</keyword>
|
220
|
+
<keyword>kind_of\?</keyword>
|
221
|
+
<keyword>iterator\?</keyword>
|
222
|
+
<keyword>is_a\?</keyword>
|
223
|
+
<keyword>instance_variables\%{no_method_suffix}</keyword>
|
224
|
+
<keyword>instance_variable_set\%{no_method_suffix}</keyword>
|
225
|
+
<keyword>instance_variable_get\%{no_method_suffix}</keyword>
|
226
|
+
<keyword>instance_variable_defined\?</keyword>
|
227
|
+
<keyword>instance_of\?</keyword>
|
228
|
+
<keyword>instance_methods\%{no_method_suffix}</keyword>
|
229
|
+
<keyword>instance_method\%{no_method_suffix}</keyword>
|
230
|
+
<keyword>instance_exec\%{no_method_suffix}</keyword>
|
231
|
+
<keyword>instance_eval\%{no_method_suffix}</keyword>
|
232
|
+
<keyword>inspect\%{no_method_suffix}</keyword>
|
233
|
+
<keyword>initialize_dup\%{no_method_suffix}</keyword>
|
234
|
+
<keyword>initialize_copy\%{no_method_suffix}</keyword>
|
235
|
+
<keyword>initialize_clone\%{no_method_suffix}</keyword>
|
236
|
+
<keyword>initialize\%{no_method_suffix}</keyword>
|
237
|
+
<keyword>included_modules\%{no_method_suffix}</keyword>
|
238
|
+
<keyword>included\%{no_method_suffix}</keyword>
|
239
|
+
<keyword>include\?</keyword>
|
240
|
+
<keyword>include\%{no_method_suffix}</keyword>
|
241
|
+
<keyword>hash\%{no_method_suffix}</keyword>
|
242
|
+
<keyword>global_variables\%{no_method_suffix}</keyword>
|
243
|
+
<keyword>gets\%{no_method_suffix}</keyword>
|
244
|
+
<keyword>gem_original_require\%{no_method_suffix}</keyword>
|
245
|
+
<keyword>gem\%{no_method_suffix}</keyword>
|
246
|
+
<keyword>frozen\?</keyword>
|
247
|
+
<keyword>freeze\%{no_method_suffix}</keyword>
|
248
|
+
<keyword>format\%{no_method_suffix}</keyword>
|
249
|
+
<keyword>fork\%{no_method_suffix}</keyword>
|
250
|
+
<keyword>fail\%{no_method_suffix}</keyword>
|
251
|
+
<keyword>extended\%{no_method_suffix}</keyword>
|
252
|
+
<keyword>extend_object\%{no_method_suffix}</keyword>
|
253
|
+
<keyword>extend\%{no_method_suffix}</keyword>
|
254
|
+
<keyword>exit\%{no_method_suffix}</keyword>
|
255
|
+
<keyword>exit!</keyword>
|
256
|
+
<keyword>exec\%{no_method_suffix}</keyword>
|
257
|
+
<keyword>eval\%{no_method_suffix}</keyword>
|
258
|
+
<keyword>equal\?</keyword>
|
259
|
+
<keyword>eql\?</keyword>
|
260
|
+
<keyword>enum_for\%{no_method_suffix}</keyword>
|
261
|
+
<keyword>dup\%{no_method_suffix}</keyword>
|
262
|
+
<keyword>display\%{no_method_suffix}</keyword>
|
263
|
+
<keyword>define_singleton_method\%{no_method_suffix}</keyword>
|
264
|
+
<keyword>define_method\%{no_method_suffix}</keyword>
|
265
|
+
<keyword>constants\%{no_method_suffix}</keyword>
|
266
|
+
<keyword>const_set\%{no_method_suffix}</keyword>
|
267
|
+
<keyword>const_missing\%{no_method_suffix}</keyword>
|
268
|
+
<keyword>const_get\%{no_method_suffix}</keyword>
|
269
|
+
<keyword>const_defined\?</keyword>
|
270
|
+
<keyword>clone\%{no_method_suffix}</keyword>
|
271
|
+
<keyword>class_variables\%{no_method_suffix}</keyword>
|
272
|
+
<keyword>class_variable_set\%{no_method_suffix}</keyword>
|
273
|
+
<keyword>class_variable_get\%{no_method_suffix}</keyword>
|
274
|
+
<keyword>class_variable_defined\?</keyword>
|
275
|
+
<keyword>class_exec\%{no_method_suffix}</keyword>
|
276
|
+
<keyword>class_eval\%{no_method_suffix}</keyword>
|
277
|
+
<keyword>class\%{no_method_suffix}</keyword>
|
278
|
+
<keyword>catch\%{no_method_suffix}</keyword>
|
279
|
+
<keyword>caller\%{no_method_suffix}</keyword>
|
280
|
+
<keyword>block_given\?</keyword>
|
281
|
+
<keyword>binding\%{no_method_suffix}</keyword>
|
282
|
+
<keyword>autoload\?</keyword>
|
283
|
+
<keyword>autoload\%{no_method_suffix}</keyword>
|
284
|
+
<keyword>attr_writer\%{no_method_suffix}</keyword>
|
285
|
+
<keyword>attr_reader\%{no_method_suffix}</keyword>
|
286
|
+
<keyword>attr_accessor\%{no_method_suffix}</keyword>
|
287
|
+
<keyword>attr\%{no_method_suffix}</keyword>
|
288
|
+
<keyword>at_exit\%{no_method_suffix}</keyword>
|
289
|
+
<keyword>append_features\%{no_method_suffix}</keyword>
|
290
|
+
<keyword>ancestors\%{no_method_suffix}</keyword>
|
291
|
+
<keyword>allocate\%{no_method_suffix}</keyword>
|
292
|
+
<keyword>alias_method\%{no_method_suffix}</keyword>
|
293
|
+
<keyword>abort\%{no_method_suffix}</keyword>
|
294
|
+
<keyword>__send__\%{no_method_suffix}</keyword>
|
295
|
+
<keyword>__method__\%{no_method_suffix}</keyword>
|
296
|
+
<keyword>__id__\%{no_method_suffix}</keyword>
|
297
|
+
<keyword>__callee__\%{no_method_suffix}</keyword>
|
298
|
+
<keyword>String(?=\()</keyword>
|
299
|
+
<keyword>Rational(?=\()</keyword>
|
300
|
+
<keyword>Integer(?=\()</keyword>
|
301
|
+
<keyword>Float(?=\()</keyword>
|
302
|
+
<keyword>Complex(?=\()</keyword>
|
303
|
+
<keyword>Array(?=\()</keyword>
|
304
|
+
</context>
|
305
|
+
|
306
|
+
<context id="important-constants" style-ref="important-constant" extend-parent="false">
|
307
|
+
<prefix>(?<!\%{alnum}::)</prefix><!-- fails on spaces or non alnum -->
|
308
|
+
<keyword>ZeroDivisionError</keyword>
|
309
|
+
<keyword>UnboundMethod</keyword>
|
310
|
+
<keyword>TypeError</keyword>
|
311
|
+
<keyword>TrueClass</keyword>
|
312
|
+
<keyword>Time</keyword>
|
313
|
+
<keyword>ThreadGroup</keyword>
|
314
|
+
<keyword>ThreadError</keyword>
|
315
|
+
<keyword>Thread</keyword>
|
316
|
+
<keyword>TRUE</keyword>
|
317
|
+
<keyword>TOPLEVEL_BINDING</keyword>
|
318
|
+
<keyword>SystemStackError</keyword>
|
319
|
+
<keyword>SystemExit</keyword>
|
320
|
+
<keyword>SystemCallError</keyword>
|
321
|
+
<keyword>SyntaxError</keyword>
|
322
|
+
<keyword>Symbol</keyword>
|
323
|
+
<keyword>Struct</keyword>
|
324
|
+
<keyword>String</keyword>
|
325
|
+
<keyword>StopIteration</keyword>
|
326
|
+
<keyword>StandardError</keyword>
|
327
|
+
<keyword>SignalException</keyword>
|
328
|
+
<keyword>Signal</keyword>
|
329
|
+
<keyword>SecurityError</keyword>
|
330
|
+
<keyword>ScriptError</keyword>
|
331
|
+
<keyword>STDOUT</keyword>
|
332
|
+
<keyword>STDIN</keyword>
|
333
|
+
<keyword>STDERR</keyword>
|
334
|
+
<keyword>SCRIPT_LINES__</keyword>
|
335
|
+
<keyword>RuntimeError</keyword>
|
336
|
+
<keyword>RubyVM</keyword>
|
337
|
+
<keyword>RegexpError</keyword>
|
338
|
+
<keyword>Regexp</keyword>
|
339
|
+
<keyword>RbConfig</keyword>
|
340
|
+
<keyword>Rational</keyword>
|
341
|
+
<keyword>RangeError</keyword>
|
342
|
+
<keyword>Range</keyword>
|
343
|
+
<keyword>Random</keyword>
|
344
|
+
<keyword>RUBY_VERSION</keyword>
|
345
|
+
<keyword>RUBY_REVISION</keyword>
|
346
|
+
<keyword>RUBY_RELEASE_DATE</keyword>
|
347
|
+
<keyword>RUBY_PLATFORM</keyword>
|
348
|
+
<keyword>RUBY_PATCHLEVEL</keyword>
|
349
|
+
<keyword>RUBY_ENGINE</keyword>
|
350
|
+
<keyword>RUBY_DESCRIPTION</keyword>
|
351
|
+
<keyword>RUBY_COPYRIGHT</keyword>
|
352
|
+
<keyword>Process</keyword>
|
353
|
+
<keyword>Proc</keyword>
|
354
|
+
<keyword>ObjectSpace</keyword>
|
355
|
+
<keyword>Object</keyword>
|
356
|
+
<keyword>Numeric</keyword>
|
357
|
+
<keyword>NotImplementedError</keyword>
|
358
|
+
<keyword>NoMethodError</keyword>
|
359
|
+
<keyword>NoMemoryError</keyword>
|
360
|
+
<keyword>NilClass</keyword>
|
361
|
+
<keyword>NameError</keyword>
|
362
|
+
<keyword>NIL</keyword>
|
363
|
+
<keyword>Mutex</keyword>
|
364
|
+
<keyword>Module</keyword>
|
365
|
+
<keyword>Method</keyword>
|
366
|
+
<keyword>Math</keyword>
|
367
|
+
<keyword>MatchData</keyword>
|
368
|
+
<keyword>Marshal</keyword>
|
369
|
+
<keyword>LocalJumpError</keyword>
|
370
|
+
<keyword>LoadError</keyword>
|
371
|
+
<keyword>KeyError</keyword>
|
372
|
+
<keyword>Kernel</keyword>
|
373
|
+
<keyword>Interrupt</keyword>
|
374
|
+
<keyword>Integer</keyword>
|
375
|
+
<keyword>IndexError</keyword>
|
376
|
+
<keyword>IOError</keyword>
|
377
|
+
<keyword>IO</keyword>
|
378
|
+
<keyword>Hash</keyword>
|
379
|
+
<keyword>Gem</keyword>
|
380
|
+
<keyword>GC</keyword>
|
381
|
+
<keyword>FloatDomainError</keyword>
|
382
|
+
<keyword>Float</keyword>
|
383
|
+
<keyword>Fixnum</keyword>
|
384
|
+
<keyword>FileTest</keyword>
|
385
|
+
<keyword>File</keyword>
|
386
|
+
<keyword>FiberError</keyword>
|
387
|
+
<keyword>Fiber</keyword>
|
388
|
+
<keyword>FalseClass</keyword>
|
389
|
+
<keyword>FALSE</keyword>
|
390
|
+
<keyword>Exception</keyword>
|
391
|
+
<keyword>Errno</keyword>
|
392
|
+
<keyword>Enumerator</keyword>
|
393
|
+
<keyword>Enumerable</keyword>
|
394
|
+
<keyword>EncodingError</keyword>
|
395
|
+
<keyword>Encoding</keyword>
|
396
|
+
<keyword>EOFError</keyword>
|
397
|
+
<keyword>ENV</keyword>
|
398
|
+
<keyword>Dir</keyword>
|
399
|
+
<keyword>Deprecate</keyword>
|
400
|
+
<keyword>Data</keyword>
|
401
|
+
<keyword>DATA</keyword>
|
402
|
+
<keyword>Config</keyword>
|
403
|
+
<keyword>Complex</keyword>
|
404
|
+
<keyword>Comparable</keyword>
|
405
|
+
<keyword>Class</keyword>
|
406
|
+
<keyword>CROSS_COMPILING</keyword>
|
407
|
+
<keyword>Binding</keyword>
|
408
|
+
<keyword>Bignum</keyword>
|
409
|
+
<keyword>BasicObject</keyword>
|
410
|
+
<keyword>Array</keyword>
|
411
|
+
<keyword>ArgumentError</keyword>
|
412
|
+
<keyword>ARGV</keyword>
|
413
|
+
<keyword>ARGF</keyword>
|
414
|
+
</context>
|
415
|
+
|
416
|
+
<define-regex id="special-variables-1-char">[;@!~&`'+=,/\\_><.*?$:"0-9]</define-regex>
|
417
|
+
<define-regex id="special-variables-2-chars">-[FK0iIvwWdpla]</define-regex>
|
418
|
+
|
419
|
+
<context id="special-variables" style-ref="special-variable">
|
420
|
+
<match extended="true">
|
421
|
+
\$( \%{special-variables-1-char}
|
422
|
+
| \%{special-variables-2-chars}
|
423
|
+
| SAFE
|
424
|
+
| KCODE
|
425
|
+
| FILENAME
|
426
|
+
| LOAD_PATH
|
427
|
+
| LOADED_FEATURES
|
428
|
+
| VERBOSE
|
429
|
+
| DEBUG
|
430
|
+
| PROGRAM_NAME
|
431
|
+
| stdin
|
432
|
+
| stdout
|
433
|
+
| stderr
|
434
|
+
| binding ) (?!\%{alnum})
|
435
|
+
</match>
|
436
|
+
</context>
|
437
|
+
|
438
|
+
<define-regex id="method" extended="true">
|
439
|
+
( \%{alnum}(?<![A-Z0-9:])\%{alnum}*[!?]?
|
440
|
+
| [A-Z]\%{alnum}*[!?]?(?=\()
|
441
|
+
)
|
442
|
+
</define-regex>
|
443
|
+
|
444
|
+
<context id="methods" style-ref="method" extend-parent="false">
|
445
|
+
<match>\%{method}</match>
|
446
|
+
</context>
|
447
|
+
|
448
|
+
<context id="global-variables" style-ref="global-variable">
|
449
|
+
<match>\$\%{alnum}(?<![0-9])\%{alnum}*</match>
|
450
|
+
</context>
|
451
|
+
|
452
|
+
<context id="class-variables" style-ref="class-variable">
|
453
|
+
<match>@@\%{alnum}(?<![0-9])\%{alnum}*</match>
|
454
|
+
</context>
|
455
|
+
|
456
|
+
<context id="instance-variables" style-ref="instance-variable">
|
457
|
+
<match>@\%{alnum}(?<![0-9])\%{alnum}*</match>
|
458
|
+
</context>
|
459
|
+
|
460
|
+
<context id="constants" style-ref="constant" extend-parent="false">
|
461
|
+
<match>[A-Z]\%{alnum}*</match>
|
462
|
+
</context>
|
463
|
+
|
464
|
+
<define-regex id="n">\d(_?\d)*</define-regex>
|
465
|
+
<define-regex id="n_pre">(?<!\w)</define-regex>
|
466
|
+
<define-regex id="n_suf">(?!\w)</define-regex>
|
467
|
+
|
468
|
+
<context id="float" style-ref="float">
|
469
|
+
<match>\%{n_pre}(\%{n}\.\%{n}|\%{n}(\.\%{n})?[eE][+-]?\%{n})\%{n_suf}</match>
|
470
|
+
</context>
|
471
|
+
|
472
|
+
<context id="integer" style-ref="integer">
|
473
|
+
<match>\%{n_pre}([1-9](_?[0-9])*|0)\%{n_suf}</match>
|
474
|
+
</context>
|
475
|
+
|
476
|
+
<context id="hex" style-ref="base-n-integer">
|
477
|
+
<match>\%{n_pre}0[xX][0-9A-Fa-f](_?[0-9A-Fa-f])*\%{n_suf}</match>
|
478
|
+
</context>
|
479
|
+
|
480
|
+
<context id="octal" style-ref="base-n-integer">
|
481
|
+
<match>\%{n_pre}0[0-7](_?[0-7])*\%{n_suf}</match>
|
482
|
+
</context>
|
483
|
+
|
484
|
+
<context id="binary" style-ref="base-n-integer">
|
485
|
+
<match>\%{n_pre}0[bB][01](_?[01])*\%{n_suf}</match>
|
486
|
+
</context>
|
487
|
+
|
488
|
+
<context id="special-values">
|
489
|
+
<include>
|
490
|
+
<context id="self" style-ref="self">
|
491
|
+
<prefix>\%{no_method_prefix}</prefix>
|
492
|
+
<suffix>\%{no_method_suffix}</suffix>
|
493
|
+
<keyword>self</keyword>
|
494
|
+
</context>
|
495
|
+
|
496
|
+
<context id="false" style-ref="false">
|
497
|
+
<prefix>\%{no_method_prefix}</prefix>
|
498
|
+
<suffix>\%{no_method_suffix}</suffix>
|
499
|
+
<keyword>false</keyword>
|
500
|
+
</context>
|
501
|
+
|
502
|
+
<context id="true" style-ref="true">
|
503
|
+
<prefix>\%{no_method_prefix}</prefix>
|
504
|
+
<suffix>\%{no_method_suffix}</suffix>
|
505
|
+
<keyword>true</keyword>
|
506
|
+
</context>
|
507
|
+
|
508
|
+
<context id="nil" style-ref="nil">
|
509
|
+
<prefix>\%{no_method_prefix}</prefix>
|
510
|
+
<suffix>\%{no_method_suffix}</suffix>
|
511
|
+
<keyword>nil</keyword>
|
512
|
+
</context>
|
513
|
+
|
514
|
+
<context id="special-values-words" style-ref="special-value">
|
515
|
+
<prefix>\%{no_method_prefix}</prefix>
|
516
|
+
<suffix>\%{no_method_suffix}</suffix>
|
517
|
+
<keyword>__ENCODING__</keyword>
|
518
|
+
<keyword>__FILE__</keyword>
|
519
|
+
<keyword>__LINE__</keyword>
|
520
|
+
</context>
|
521
|
+
</include>
|
522
|
+
</context>
|
523
|
+
|
524
|
+
<context id="block-parameters">
|
525
|
+
<start>(?<=do|\{)\s*(\|)</start>
|
526
|
+
<end>\|</end>
|
527
|
+
<include>
|
528
|
+
<context sub-pattern="1" where="start" style-ref="syntax-char"/>
|
529
|
+
<context sub-pattern="0" where="end" style-ref="syntax-char"/>
|
530
|
+
<context ref="ruby-end-at-line-end"/>
|
531
|
+
</include>
|
532
|
+
</context>
|
533
|
+
|
534
|
+
<context id="question-mark-string" style-ref="character">
|
535
|
+
<match>(?<![\w\.)\]}])\s*\?((\\[MC]-){1,2}|\\?)\S</match>
|
536
|
+
</context>
|
537
|
+
|
538
|
+
<context id="interpolation" style-ref="string-delimiter">
|
539
|
+
<start>#\{</start>
|
540
|
+
<end>\}</end>
|
541
|
+
<include>
|
542
|
+
<context ref="ruby:*"/>
|
543
|
+
</include>
|
544
|
+
</context>
|
545
|
+
|
546
|
+
<context id="variable-interpolation">
|
547
|
+
<start>(#)(?=[@$])</start>
|
548
|
+
<end>(?!\%{alnum})</end>
|
549
|
+
<include>
|
550
|
+
<context where="start" sub-pattern="1" style-ref="string-delimiter"/>
|
551
|
+
<context ref="class-variables"/>
|
552
|
+
<context ref="instance-variables"/>
|
553
|
+
<context ref="special-variables"/>
|
554
|
+
<context ref="global-variables"/>
|
555
|
+
</include>
|
556
|
+
</context>
|
557
|
+
|
558
|
+
<context id="double-quoted">
|
559
|
+
<include>
|
560
|
+
<context ref="special-chars"/>
|
561
|
+
<context ref="interpolation"/>
|
562
|
+
<context ref="variable-interpolation"/>
|
563
|
+
</include>
|
564
|
+
</context>
|
565
|
+
|
566
|
+
<!-- ruby strings do not end at line end, so we cannot use def:string (parts lifted from perl.lang) -->
|
567
|
+
<!-- 'Hello world' -->
|
568
|
+
<context id="double-quoted-string" style-ref="string" class-disabled="no-spell-check" style-inside="true">
|
569
|
+
<start>"</start>
|
570
|
+
<end>"</end>
|
571
|
+
<include>
|
572
|
+
<context style-ref="special-char"><match>\\[\"\\]</match></context>
|
573
|
+
<context ref="double-quoted"/>
|
574
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
575
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
576
|
+
</include>
|
577
|
+
</context>
|
578
|
+
|
579
|
+
<!-- %Q{Hello world} %{Hello world} -->
|
580
|
+
<context id="double-quoted-string-curly" style-ref="string">
|
581
|
+
<start>%Q?\{</start>
|
582
|
+
<end>\}</end>
|
583
|
+
<include>
|
584
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
585
|
+
<context ref="double-quoted"/>
|
586
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
587
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
588
|
+
</include>
|
589
|
+
</context>
|
590
|
+
|
591
|
+
<!-- %Q(Hello world) %(Hello world) -->
|
592
|
+
<context id="double-quoted-string-normal" style-ref="string">
|
593
|
+
<start>%Q?\(</start>
|
594
|
+
<end>\)</end>
|
595
|
+
<include>
|
596
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
597
|
+
<context ref="double-quoted"/>
|
598
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
599
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
600
|
+
</include>
|
601
|
+
</context>
|
602
|
+
|
603
|
+
<!-- %Q[Hello world] %[Hello world] -->
|
604
|
+
<context id="double-quoted-string-square" style-ref="string">
|
605
|
+
<start>%Q?\[</start>
|
606
|
+
<end>\]</end>
|
607
|
+
<include>
|
608
|
+
<context style-ref="special-char"><match>\\[\]\\]</match></context>
|
609
|
+
<context ref="double-quoted"/>
|
610
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
611
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
612
|
+
</include>
|
613
|
+
</context>
|
614
|
+
|
615
|
+
<!-- %Q<Hello world> %<Hello world> -->
|
616
|
+
<context id="double-quoted-string-angle" style-ref="string">
|
617
|
+
<start>%Q?<</start>
|
618
|
+
<end>></end>
|
619
|
+
<include>
|
620
|
+
<context style-ref="special-char"><match>\\[>\\]</match></context>
|
621
|
+
<context ref="double-quoted"/>
|
622
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
623
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
624
|
+
</include>
|
625
|
+
</context>
|
626
|
+
|
627
|
+
<!-- %Q-Hello world- %-Hello world- %+hello world+ and so on... -->
|
628
|
+
<context id="double-quoted-string-generic" style-ref="string">
|
629
|
+
<start>%Q?([[:print:]])(?<![[:alnum:]])</start>
|
630
|
+
<end>\%{1@start}</end>
|
631
|
+
<include>
|
632
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
633
|
+
<context ref="double-quoted"/>
|
634
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
635
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
636
|
+
</include>
|
637
|
+
</context>
|
638
|
+
|
639
|
+
<!-- 'Hello world' -->
|
640
|
+
<context id="single-quoted-string" style-ref="string" class-disabled="no-spell-check">
|
641
|
+
<start>'</start>
|
642
|
+
<end>'</end>
|
643
|
+
<include>
|
644
|
+
<context style-ref="special-char"><match>\\['\\]</match></context>
|
645
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
646
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
647
|
+
</include>
|
648
|
+
</context>
|
649
|
+
|
650
|
+
<!-- %q{Hello world} -->
|
651
|
+
<context id="single-quoted-string-curly" style-ref="string">
|
652
|
+
<start>%q\{</start>
|
653
|
+
<end>\}</end>
|
654
|
+
<include>
|
655
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
656
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
657
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
658
|
+
</include>
|
659
|
+
</context>
|
660
|
+
|
661
|
+
<!-- %q(Hello world) -->
|
662
|
+
<context id="single-quoted-string-normal" style-ref="string">
|
663
|
+
<start>%q\(</start>
|
664
|
+
<end>\)</end>
|
665
|
+
<include>
|
666
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
667
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
668
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
669
|
+
</include>
|
670
|
+
</context>
|
671
|
+
|
672
|
+
<!-- %q[Hello world] -->
|
673
|
+
<context id="single-quoted-string-square" style-ref="string">
|
674
|
+
<start>%q\[</start>
|
675
|
+
<end>\]</end>
|
676
|
+
<include><context style-ref="special-char"><match>\\[\]\\]</match></context>
|
677
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
678
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
679
|
+
</include>
|
680
|
+
</context>
|
681
|
+
|
682
|
+
<!-- %q<Hello world> -->
|
683
|
+
<context id="single-quoted-string-angle" style-ref="string">
|
684
|
+
<start>%q<</start>
|
685
|
+
<end>></end>
|
686
|
+
<include>
|
687
|
+
<context style-ref="special-char"><match>\\[%gt;\\]</match></context>
|
688
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
689
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
690
|
+
</include>
|
691
|
+
</context>
|
692
|
+
|
693
|
+
<!-- %q-Hello world- %q+Hello world+ %q*Hello world* and so on... -->
|
694
|
+
<context id="single-quoted-string-generic" style-ref="string">
|
695
|
+
<start>%q([[:print:]])(?<![[:alnum:]])</start>
|
696
|
+
<end>\%{1@start}</end>
|
697
|
+
<include>
|
698
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
699
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
700
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
701
|
+
</include>
|
702
|
+
</context>
|
703
|
+
|
704
|
+
<!-- Arrays of strings
|
705
|
+
%W{Array of #{interpolated} strings} -->
|
706
|
+
<context id="double-quoted-word-array-curly" style-ref="string">
|
707
|
+
<start>%W\{</start>
|
708
|
+
<end>\}</end>
|
709
|
+
<include>
|
710
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
711
|
+
<context ref="double-quoted"/>
|
712
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
713
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
714
|
+
</include>
|
715
|
+
</context>
|
716
|
+
|
717
|
+
<!-- %W(Array of #{interpolated} strings) -->
|
718
|
+
<context id="double-quoted-word-array-normal" style-ref="string">
|
719
|
+
<start>%W\(</start>
|
720
|
+
<end>\)</end>
|
721
|
+
<include>
|
722
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
723
|
+
<context ref="double-quoted"/>
|
724
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
725
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
726
|
+
</include>
|
727
|
+
</context>
|
728
|
+
|
729
|
+
<!-- %W[Array of #{interpolated} strings] -->
|
730
|
+
<context id="double-quoted-word-array-square" style-ref="string">
|
731
|
+
<start>%W\[</start>
|
732
|
+
<end>\]</end>
|
733
|
+
<include>
|
734
|
+
<context style-ref="special-char"><match>\\[\]\\]</match></context>
|
735
|
+
<context ref="double-quoted"/>
|
736
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
737
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
738
|
+
</include>
|
739
|
+
</context>
|
740
|
+
|
741
|
+
<!-- %W<Array of #{interpolated} strings> -->
|
742
|
+
<context id="double-quoted-word-array-angle" style-ref="string">
|
743
|
+
<start>%W<</start>
|
744
|
+
<end>></end>
|
745
|
+
<include>
|
746
|
+
<context style-ref="special-char"><match>\\[>\\]</match></context>
|
747
|
+
<context ref="double-quoted"/>
|
748
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
749
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
750
|
+
</include>
|
751
|
+
</context>
|
752
|
+
|
753
|
+
<!-- %W-Array of #{interpolated} strings-
|
754
|
+
%W+Array of #{interpolated} strings+
|
755
|
+
%W*Array of #{interpolated} strings* and so on... -->
|
756
|
+
<context id="double-quoted-word-array-generic" style-ref="string">
|
757
|
+
<start>%W([[:print:]])(?<![[:alnum:]])</start>
|
758
|
+
<end>\%{1@start}</end>
|
759
|
+
<include>
|
760
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
761
|
+
<context ref="double-quoted"/>
|
762
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
763
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
764
|
+
</include>
|
765
|
+
</context>
|
766
|
+
|
767
|
+
<!-- %w{Array of strings} -->
|
768
|
+
<context id="single-quoted-word-array-curly" style-ref="string">
|
769
|
+
<start>%w\{</start>
|
770
|
+
<end>\}</end>
|
771
|
+
<include>
|
772
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
773
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
774
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
775
|
+
</include>
|
776
|
+
</context>
|
777
|
+
|
778
|
+
<!-- %w(Array of strings) -->
|
779
|
+
<context id="single-quoted-word-array-normal" style-ref="string">
|
780
|
+
<start>%w\(</start>
|
781
|
+
<end>\)</end>
|
782
|
+
<include>
|
783
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
784
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
785
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
786
|
+
</include>
|
787
|
+
</context>
|
788
|
+
|
789
|
+
<!-- %w[Array of strings] -->
|
790
|
+
<context id="single-quoted-word-array-square" style-ref="string">
|
791
|
+
<start>%w\[</start>
|
792
|
+
<end>\]</end>
|
793
|
+
<include>
|
794
|
+
<context style-ref="special-char"><match>\\[\]\\]</match></context>
|
795
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
796
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
797
|
+
</include>
|
798
|
+
</context>
|
799
|
+
|
800
|
+
<!-- %w<Array of strings> -->
|
801
|
+
<context id="single-quoted-word-array-angle" style-ref="string">
|
802
|
+
<start>%w<</start>
|
803
|
+
<end>></end>
|
804
|
+
<include>
|
805
|
+
<context style-ref="special-char"><match>\\[>\\]</match></context>
|
806
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
807
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
808
|
+
</include>
|
809
|
+
</context>
|
810
|
+
|
811
|
+
<!-- %w-Array of strings- %w+Array of strings+ %w*Array of strings* and so on... -->
|
812
|
+
<context id="single-quoted-word-array-generic" style-ref="string">
|
813
|
+
<start>%w([[:print:]])(?<![[:alnum:]])</start>
|
814
|
+
<end>\%{1@start}</end>
|
815
|
+
<include>
|
816
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
817
|
+
<context where="start" sub-pattern="0" style-ref="collection"/>
|
818
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
819
|
+
</include>
|
820
|
+
</context>
|
821
|
+
|
822
|
+
<context id="backtick-quoted-string" style-ref="system" extend-parent="false">
|
823
|
+
<start>`</start>
|
824
|
+
<end>`</end>
|
825
|
+
<include>
|
826
|
+
<context style-ref="special-char"><match>\\[`\\]</match></context>
|
827
|
+
<context ref="double-quoted"/>
|
828
|
+
<context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
829
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
830
|
+
</include>
|
831
|
+
</context>
|
832
|
+
|
833
|
+
<context id="backtick-quoted-string-curly" style-ref="system">
|
834
|
+
<start>%x\{</start>
|
835
|
+
<end>\}</end>
|
836
|
+
<include>
|
837
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
838
|
+
<context ref="double-quoted"/>
|
839
|
+
<context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
840
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
841
|
+
</include>
|
842
|
+
</context>
|
843
|
+
|
844
|
+
<context id="backtick-quoted-string-normal" style-ref="system">
|
845
|
+
<start>%x\(</start>
|
846
|
+
<end>\)</end>
|
847
|
+
<include><context style-ref="special-char"><match>\\[)\\]</match></context>
|
848
|
+
<context ref="double-quoted"/><context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
849
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/></include>
|
850
|
+
</context>
|
851
|
+
|
852
|
+
<context id="backtick-quoted-string-square" style-ref="system">
|
853
|
+
<start>%x\[</start>
|
854
|
+
<end>\]</end>
|
855
|
+
<include>
|
856
|
+
<context style-ref="special-char"><match>\\[\]\\]</match></context>
|
857
|
+
<context ref="double-quoted"/>
|
858
|
+
<context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
859
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
860
|
+
</include>
|
861
|
+
</context>
|
862
|
+
|
863
|
+
<context id="backtick-quoted-string-angle" style-ref="system">
|
864
|
+
<start>%x<</start>
|
865
|
+
<end>></end>
|
866
|
+
<include>
|
867
|
+
<context style-ref="special-char"><match>\\[>\\]</match></context>
|
868
|
+
<context ref="double-quoted"/>
|
869
|
+
<context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
870
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
871
|
+
</include>
|
872
|
+
</context>
|
873
|
+
|
874
|
+
<context id="backtick-quoted-string-generic" style-ref="system">
|
875
|
+
<start>%x([[:print:]])(?<![[:alnum:]])</start>
|
876
|
+
<end>\%{1@start}</end>
|
877
|
+
<include>
|
878
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
879
|
+
<context ref="double-quoted"/>
|
880
|
+
<context where="start" sub-pattern="0" style-ref="system-delimiter"/>
|
881
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
882
|
+
</include>
|
883
|
+
</context>
|
884
|
+
|
885
|
+
<define-regex id="start-heredoc">([^a-zA-Z0-9\s\]\)>}]|^)\s*(<<)</define-regex>
|
886
|
+
|
887
|
+
<context id="heredoc-string" style-ref="string">
|
888
|
+
<start>\%{start-heredoc}((\w+))</start>
|
889
|
+
<end>^\%{4@start}$</end>
|
890
|
+
<include>
|
891
|
+
<context ref="ruby-end-at-line-end"/>
|
892
|
+
<context ref="double-quoted"/>
|
893
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
894
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
895
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
896
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
897
|
+
</include>
|
898
|
+
</context>
|
899
|
+
|
900
|
+
<context id="heredoc-indented-string" style-ref="string">
|
901
|
+
<start>\%{start-heredoc}(-(\w+))</start>
|
902
|
+
<end>^\s*\%{4@start}$</end>
|
903
|
+
<include>
|
904
|
+
<context ref="ruby-end-at-line-end"/>
|
905
|
+
<context ref="double-quoted"/>
|
906
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
907
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
908
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
909
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
910
|
+
</include>
|
911
|
+
</context>
|
912
|
+
|
913
|
+
<context id="heredoc-single-quoted-string" style-ref="string">
|
914
|
+
<start>\%{start-heredoc}('(\w+)')</start>
|
915
|
+
<end>^\%{4@start}$</end>
|
916
|
+
<include>
|
917
|
+
<context ref="ruby-end-at-line-end"/>
|
918
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
919
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
920
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
921
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
922
|
+
</include>
|
923
|
+
</context>
|
924
|
+
|
925
|
+
<context id="heredoc-double-quoted-string" style-ref="string">
|
926
|
+
<start>\%{start-heredoc}("(\w+)")</start>
|
927
|
+
<end>^\%{4@start}$</end>
|
928
|
+
<include>
|
929
|
+
<context ref="ruby-end-at-line-end"/>
|
930
|
+
<context ref="double-quoted"/>
|
931
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
932
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
933
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
934
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
935
|
+
</include>
|
936
|
+
</context>
|
937
|
+
|
938
|
+
<context id="heredoc-backtick-quoted-string" style-ref="system">
|
939
|
+
<start>\%{start-heredoc}(`(\w+)`)</start>
|
940
|
+
<end>^\%{4@start}$</end>
|
941
|
+
<include>
|
942
|
+
<context ref="ruby-end-at-line-end"/>
|
943
|
+
<context ref="double-quoted"/>
|
944
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
945
|
+
<context where="start" sub-pattern="2" style-ref="system-delimiter"/>
|
946
|
+
<context where="start" sub-pattern="3" style-ref="system-delimiter"/>
|
947
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
948
|
+
</include>
|
949
|
+
</context>
|
950
|
+
|
951
|
+
<context id="heredoc-single-quoted-indented-string" style-ref="string">
|
952
|
+
<start>\%{start-heredoc}(-'(\w+)')</start>
|
953
|
+
<end>^\s*\%{4@start}$</end>
|
954
|
+
<include>
|
955
|
+
<context ref="ruby-end-at-line-end"/>
|
956
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
957
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
958
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
959
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
960
|
+
</include>
|
961
|
+
</context>
|
962
|
+
|
963
|
+
<context id="heredoc-double-quoted-indented-string" style-ref="string">
|
964
|
+
<start>\%{start-heredoc}(-"(\w+)")</start>
|
965
|
+
<end>^\s*\%{4@start}$</end>
|
966
|
+
<include>
|
967
|
+
<context ref="ruby-end-at-line-end"/>
|
968
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
969
|
+
<context where="start" sub-pattern="2" style-ref="string-delimiter"/>
|
970
|
+
<context where="start" sub-pattern="3" style-ref="string-delimiter"/>
|
971
|
+
<context where="end" sub-pattern="0" style-ref="string-delimiter"/>
|
972
|
+
</include>
|
973
|
+
</context>
|
974
|
+
|
975
|
+
<context id="heredoc-backtick-quoted-indented-string" style-ref="system">
|
976
|
+
<start>\%{start-heredoc}(-`(\w+)`)</start>
|
977
|
+
<end>^\s*\%{4@start}$</end>
|
978
|
+
<include>
|
979
|
+
<context ref="ruby-end-at-line-end"/>
|
980
|
+
<context where="start" sub-pattern="1" style-ref="operator"/>
|
981
|
+
<context where="start" sub-pattern="2" style-ref="system-delimiter"/>
|
982
|
+
<context where="start" sub-pattern="3" style-ref="system-delimiter"/>
|
983
|
+
<context where="end" sub-pattern="0" style-ref="system-delimiter"/>
|
984
|
+
</include>
|
985
|
+
</context>
|
986
|
+
|
987
|
+
<define-regex id="regex-options">([mixo]*[neus]?[mixo]*)</define-regex>
|
988
|
+
|
989
|
+
<context id="regex" style-ref="regex">
|
990
|
+
<start extended="true">
|
991
|
+
\/
|
992
|
+
(?=
|
993
|
+
([^/\\]*(\\.))*
|
994
|
+
[^/]*
|
995
|
+
\/\%{regex-options}
|
996
|
+
)</start>
|
997
|
+
<end>(\/)\%{regex-options}</end>
|
998
|
+
<include>
|
999
|
+
<context style-ref="special-char"><match>\\[/\\]</match></context>
|
1000
|
+
<context ref="double-quoted"/>
|
1001
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1002
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1003
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1004
|
+
</include>
|
1005
|
+
</context>
|
1006
|
+
|
1007
|
+
<context id="regex-curly" style-ref="regex">
|
1008
|
+
<start>%r\{</start>
|
1009
|
+
<end>(\})%{regex-options}</end>
|
1010
|
+
<include>
|
1011
|
+
<context style-ref="special-char"><match>\\[/\\]</match></context>
|
1012
|
+
<context ref="double-quoted"/>
|
1013
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1014
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1015
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1016
|
+
</include>
|
1017
|
+
</context>
|
1018
|
+
|
1019
|
+
<context id="regex-normal" style-ref="regex">
|
1020
|
+
<start>%r\(</start>
|
1021
|
+
<end>(\))%{regex-options}</end>
|
1022
|
+
<include>
|
1023
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
1024
|
+
<context ref="double-quoted"/>
|
1025
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1026
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1027
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1028
|
+
</include>
|
1029
|
+
</context>
|
1030
|
+
|
1031
|
+
<context id="regex-square" style-ref="regex">
|
1032
|
+
<start>%r\[</start>
|
1033
|
+
<end>(\])%{regex-options}</end>
|
1034
|
+
<include>
|
1035
|
+
<context style-ref="special-char"><match>\\[\]\\]</match></context>
|
1036
|
+
<context ref="double-quoted"/>
|
1037
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1038
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1039
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1040
|
+
</include>
|
1041
|
+
</context>
|
1042
|
+
|
1043
|
+
<context id="regex-angle" style-ref="regex">
|
1044
|
+
<start>%r<</start>
|
1045
|
+
<end>(>)\%{regex-options}</end>
|
1046
|
+
<include>
|
1047
|
+
<context style-ref="special-char"><match>\\[>\\]</match></context>
|
1048
|
+
<context ref="double-quoted"/>
|
1049
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1050
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1051
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1052
|
+
</include>
|
1053
|
+
</context>
|
1054
|
+
|
1055
|
+
<context id="regex-generic" style-ref="regex">
|
1056
|
+
<start>%r([[:print:]])(?<![[:alnum:]])</start>
|
1057
|
+
<end>(\%{1@start})\%{regex-options}</end>
|
1058
|
+
<include>
|
1059
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
1060
|
+
<context ref="double-quoted"/>
|
1061
|
+
<context where="start" sub-pattern="0" style-ref="regex-delimiter"/>
|
1062
|
+
<context where="end" sub-pattern="1" style-ref="regex-delimiter"/>
|
1063
|
+
<context where="end" sub-pattern="2" style-ref="regex-options"/>
|
1064
|
+
</include>
|
1065
|
+
</context>
|
1066
|
+
|
1067
|
+
<context id="symbol" style-ref="symbol">
|
1068
|
+
<start extended="true">
|
1069
|
+
(?<!:)(:)
|
1070
|
+
( \$ \%{special-variables-1-char}
|
1071
|
+
| \$ \%{special-variables-2-chars}
|
1072
|
+
| (?:\%{alnum}|\$|@@?) (?<![0-9]) \%{alnum}* [?!=]?
|
1073
|
+
| <=> | <= | >= | <<? | >>? | != | [!=]~ | ===? | \[\]=? | \*\*? | [+-]@?
|
1074
|
+
| [!|~\^&]
|
1075
|
+
)
|
1076
|
+
</start>
|
1077
|
+
<end></end>
|
1078
|
+
<include>
|
1079
|
+
<context where="start" sub-pattern="1" style-ref="symbol-delimiter"/>
|
1080
|
+
</include>
|
1081
|
+
</context>
|
1082
|
+
|
1083
|
+
<context id="ternary-operators">
|
1084
|
+
<start>\?</start>
|
1085
|
+
<end>:</end>
|
1086
|
+
<include>
|
1087
|
+
<context where="start" sub-pattern="0" style-ref="operator"/>
|
1088
|
+
<context where="end" sub-pattern="0" style-ref="operator"/>
|
1089
|
+
<context ref="ruby:*"/>
|
1090
|
+
</include>
|
1091
|
+
</context>
|
1092
|
+
|
1093
|
+
<context id="hash-symbols" style-ref="symbol" extend-parent="false">
|
1094
|
+
<start extended="true">
|
1095
|
+
(?=\%{alnum}+:) \%{alnum} (?<![0-9]) \%{alnum}* [?!=]? (:) (?!:)
|
1096
|
+
</start>
|
1097
|
+
<end></end>
|
1098
|
+
<include>
|
1099
|
+
<context where="start" sub-pattern="1" style-ref="symbol-delimiter"/>
|
1100
|
+
</include>
|
1101
|
+
</context>
|
1102
|
+
|
1103
|
+
<context id="single-quoted-symbol" style-ref="symbol">
|
1104
|
+
<start>:'</start>
|
1105
|
+
<end>'</end>
|
1106
|
+
<include>
|
1107
|
+
<context style-ref="special-char"><match>\\[\'\\]</match></context>
|
1108
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1109
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1110
|
+
</include>
|
1111
|
+
</context>
|
1112
|
+
|
1113
|
+
<context id="double-quoted-symbol" style-ref="symbol">
|
1114
|
+
<start>:"</start>
|
1115
|
+
<end>"</end>
|
1116
|
+
<include>
|
1117
|
+
<context style-ref="special-char"><match>\\[\"\\]</match></context>
|
1118
|
+
<context ref="double-quoted"/>
|
1119
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1120
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1121
|
+
</include>
|
1122
|
+
</context>
|
1123
|
+
|
1124
|
+
<!-- %s{Hello world} -->
|
1125
|
+
<context id="single-quoted-symbol-curly" style-ref="symbol">
|
1126
|
+
<start>%s\{</start>
|
1127
|
+
<end>\}</end>
|
1128
|
+
<include>
|
1129
|
+
<context style-ref="special-char"><match>\\[}\\]</match></context>
|
1130
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1131
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1132
|
+
</include>
|
1133
|
+
</context>
|
1134
|
+
|
1135
|
+
<!-- %s(Hello world) -->
|
1136
|
+
<context id="single-quoted-symbol-normal" style-ref="symbol">
|
1137
|
+
<start>%s\(</start>
|
1138
|
+
<end>\)</end>
|
1139
|
+
<include>
|
1140
|
+
<context style-ref="special-char"><match>\\[)\\]</match></context>
|
1141
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1142
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1143
|
+
</include>
|
1144
|
+
</context>
|
1145
|
+
|
1146
|
+
<!-- %s[Hello world] -->
|
1147
|
+
<context id="single-quoted-symbol-square" style-ref="symbol">
|
1148
|
+
<start>%s\[</start>
|
1149
|
+
<end>\]</end>
|
1150
|
+
<include><context style-ref="special-char"><match>\\[\]\\]</match></context>
|
1151
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1152
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1153
|
+
</include>
|
1154
|
+
</context>
|
1155
|
+
|
1156
|
+
<!-- %s<Hello world> -->
|
1157
|
+
<context id="single-quoted-symbol-angle" style-ref="symbol">
|
1158
|
+
<start>%s<</start>
|
1159
|
+
<end>></end>
|
1160
|
+
<include>
|
1161
|
+
<context style-ref="special-char"><match>\\[%gt;\\]</match></context>
|
1162
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1163
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1164
|
+
</include>
|
1165
|
+
</context>
|
1166
|
+
|
1167
|
+
<!-- %s-Hello world- %s+Hello world+ %s*Hello world* and so on... -->
|
1168
|
+
<context id="single-quoted-symbol-generic" style-ref="symbol">
|
1169
|
+
<start>%s([[:print:]])(?<![[:alnum:]])</start>
|
1170
|
+
<end>\%{1@start}</end>
|
1171
|
+
<include>
|
1172
|
+
<!--context style-ref="special-char"><match>\\[\%{1@start}\\]</match></context-->
|
1173
|
+
<context where="start" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1174
|
+
<context where="end" sub-pattern="0" style-ref="symbol-delimiter"/>
|
1175
|
+
</include>
|
1176
|
+
</context>
|
1177
|
+
|
1178
|
+
<define-regex id="definable-operator" extended="true">
|
1179
|
+
===?
|
1180
|
+
| <=>
|
1181
|
+
| <[<=]?
|
1182
|
+
| (?<!=)>[>=]?
|
1183
|
+
| =?~
|
1184
|
+
| \*\*?
|
1185
|
+
| \[\]=?
|
1186
|
+
| [+%^!/|&-]
|
1187
|
+
</define-regex>
|
1188
|
+
|
1189
|
+
<context id="function">
|
1190
|
+
<start>(?<![\w\.])\b(def)\b\s*</start>
|
1191
|
+
<end>(\%{definable-operator}|[A-Z]?\%{method}(?:(?<![!?])=)?)(?=[\s(;]|$)</end>
|
1192
|
+
<include>
|
1193
|
+
<context where="start" sub-pattern="1" style-ref="keyword"/>
|
1194
|
+
<context where="end" sub-pattern="0" style-ref="function"/>
|
1195
|
+
<context ref="ruby-end-at-line-end"/>
|
1196
|
+
</include>
|
1197
|
+
</context>
|
1198
|
+
|
1199
|
+
<context id="operators" style-ref="operator">
|
1200
|
+
<match extended="true">
|
1201
|
+
( [+-]@
|
1202
|
+
| \%{definable-operator}
|
1203
|
+
| (?<!%)=(?!>)
|
1204
|
+
| \.
|
1205
|
+
| ::
|
1206
|
+
| \%{no_method_prefix}(?:not|and|or)\%{no_method_suffix}
|
1207
|
+
| \%{no_method_prefix}defined\?
|
1208
|
+
)
|
1209
|
+
</match>
|
1210
|
+
</context>
|
1211
|
+
|
1212
|
+
<context id="syntax-chars" style-ref="syntax-char" extend-parent="false">
|
1213
|
+
<match>[\\;]</match>
|
1214
|
+
</context>
|
1215
|
+
|
1216
|
+
<context id="brackets">
|
1217
|
+
<include>
|
1218
|
+
<context id="normal-brackets">
|
1219
|
+
<start>\(</start><end>\)</end>
|
1220
|
+
<include>
|
1221
|
+
<context where="start" sub-pattern="0" style-ref="syntax-char"/>
|
1222
|
+
<context where="end" sub-pattern="0" style-ref="syntax-char"/>
|
1223
|
+
<context ref="ruby:*"/>
|
1224
|
+
</include>
|
1225
|
+
</context>
|
1226
|
+
<context id="square-brackets">
|
1227
|
+
<start extended="true">
|
1228
|
+
(?: (?<= \%{alnum}[!?] )
|
1229
|
+
| (?<= \%{alnum} | [})\]] )
|
1230
|
+
)
|
1231
|
+
|
1232
|
+
(?<! \%{no_method_prefix}
|
1233
|
+
BEGIN | END | alias | begin | break | case | class | do | else | elsif |
|
1234
|
+
end | ensure | for | if | in | module | next | redo | rescue | retry |
|
1235
|
+
return | super | then | undef | unless | until | when | while | yield
|
1236
|
+
)
|
1237
|
+
|
1238
|
+
\s* (\[)
|
1239
|
+
</start>
|
1240
|
+
<end>\]</end>
|
1241
|
+
<include>
|
1242
|
+
<context where="start" sub-pattern="1" style-ref="syntax-char"/>
|
1243
|
+
<context where="end" sub-pattern="0" style-ref="syntax-char"/>
|
1244
|
+
<context ref="ruby:*"/>
|
1245
|
+
</include>
|
1246
|
+
</context>
|
1247
|
+
<context id="curly-brackets"><!--(?<= [)\w\]] ) --><!-- TODO why does keyword ref not work? -->
|
1248
|
+
<start extended="true">
|
1249
|
+
(?: (?<= -> | \%{alnum}[!?] )
|
1250
|
+
| (?<= \%{alnum} | [)\]] )
|
1251
|
+
)
|
1252
|
+
|
1253
|
+
(?<! \%{no_method_prefix}
|
1254
|
+
BEGIN | END | alias | begin | break | case | class | do | else | elsif |
|
1255
|
+
end | ensure | for | if | in | module | next | redo | rescue | retry |
|
1256
|
+
return | super | then | undef | unless | until | when | while | yield
|
1257
|
+
)
|
1258
|
+
|
1259
|
+
\s* (\{)
|
1260
|
+
</start>
|
1261
|
+
<end>\}</end>
|
1262
|
+
<include>
|
1263
|
+
<context where="start" sub-pattern="1" style-ref="syntax-char"/>
|
1264
|
+
<context where="end" sub-pattern="0" style-ref="syntax-char"/>
|
1265
|
+
<context ref="ruby:*"/>
|
1266
|
+
</include>
|
1267
|
+
</context>
|
1268
|
+
</include>
|
1269
|
+
</context>
|
1270
|
+
|
1271
|
+
<context id="hash">
|
1272
|
+
<start extended="true">
|
1273
|
+
(?: (?<= \%{no_method_prefix}
|
1274
|
+
BEGIN | END | alias | begin | break | case | class | do | else | elsif |
|
1275
|
+
end | ensure | for | if | in | module | next | redo | rescue | retry |
|
1276
|
+
return | super | then | undef | unless | until | when | while | yield
|
1277
|
+
)
|
1278
|
+
| (?<! -> | \%{alnum}[!?] )
|
1279
|
+
(?<! \%{alnum} | [)\]] )
|
1280
|
+
)
|
1281
|
+
(\{)
|
1282
|
+
</start>
|
1283
|
+
<end>\}</end>
|
1284
|
+
<include>
|
1285
|
+
<context where="start" sub-pattern="1" style-ref="collection"/>
|
1286
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
1287
|
+
<context ref="ruby:*"/>
|
1288
|
+
</include>
|
1289
|
+
</context>
|
1290
|
+
|
1291
|
+
<context id="array">
|
1292
|
+
<start extended="true">
|
1293
|
+
(?: (?<= \%{no_method_prefix}
|
1294
|
+
BEGIN | END | alias | begin | break | case | class | do | else | elsif |
|
1295
|
+
end | ensure | for | if | in | module | next | redo | rescue | retry |
|
1296
|
+
return | super | then | undef | unless | until | when | while | yield
|
1297
|
+
)
|
1298
|
+
| (?<! \%{alnum}[!?] )
|
1299
|
+
(?<! \%{alnum} | [})\]] )
|
1300
|
+
)
|
1301
|
+
(\[)
|
1302
|
+
</start>
|
1303
|
+
<end>\]</end>
|
1304
|
+
<include>
|
1305
|
+
<context where="start" sub-pattern="1" style-ref="collection"/>
|
1306
|
+
<context where="end" sub-pattern="0" style-ref="collection"/>
|
1307
|
+
<context ref="ruby:*"/>
|
1308
|
+
</include>
|
1309
|
+
</context>
|
1310
|
+
|
1311
|
+
<context id="collection-chars" style-ref="collection">
|
1312
|
+
<match>(=>|,)</match>
|
1313
|
+
</context>
|
1314
|
+
|
1315
|
+
<context id="lambdas" style-ref="syntax-chars">
|
1316
|
+
<match>-></match>
|
1317
|
+
</context>
|
1318
|
+
|
1319
|
+
<context id="data" style-ref="string">
|
1320
|
+
<start>^__END__$</start>
|
1321
|
+
<include>
|
1322
|
+
<context where="start" sub-pattern="0" style-ref="string-delimiter"/>
|
1323
|
+
</include>
|
1324
|
+
</context>
|
1325
|
+
|
1326
|
+
<context id="errors" style-ref="error" extend-parent="false"><!-- split if needed -->
|
1327
|
+
<match extended="true">
|
1328
|
+
(?: [}\])]
|
1329
|
+
| =end\%{no_method_suffix}
|
1330
|
+
)
|
1331
|
+
</match>
|
1332
|
+
</context>
|
1333
|
+
|
1334
|
+
<context id="ruby-end-at-line-end" end-at-line-end="true" once-only="true" extend-parent="false">
|
1335
|
+
<start></start>
|
1336
|
+
<end>(^|$)</end>
|
1337
|
+
<include>
|
1338
|
+
<context ref="ruby:*"/>
|
1339
|
+
</include>
|
1340
|
+
</context>
|
1341
|
+
|
1342
|
+
<context id="ruby" class="no-spell-check">
|
1343
|
+
<include>
|
1344
|
+
<context ref="def:shebang"/>
|
1345
|
+
<context ref="encoding-comment"/>
|
1346
|
+
<context ref="shell-like-comment"/><!-- not from def -->
|
1347
|
+
<context ref="multiline-comment"/>
|
1348
|
+
<context ref="data"/>
|
1349
|
+
|
1350
|
+
<context ref="heredoc-string"/>
|
1351
|
+
<context ref="heredoc-single-quoted-string"/>
|
1352
|
+
<context ref="heredoc-double-quoted-string"/>
|
1353
|
+
<context ref="heredoc-backtick-quoted-string"/>
|
1354
|
+
<context ref="heredoc-indented-string"/>
|
1355
|
+
<context ref="heredoc-single-quoted-indented-string"/>
|
1356
|
+
<context ref="heredoc-double-quoted-indented-string"/>
|
1357
|
+
<context ref="heredoc-backtick-quoted-indented-string"/>
|
1358
|
+
|
1359
|
+
<context ref="symbol"/>
|
1360
|
+
<context ref="single-quoted-symbol"/>
|
1361
|
+
<context ref="double-quoted-symbol"/>
|
1362
|
+
<context ref="single-quoted-symbol-curly"/>
|
1363
|
+
<context ref="single-quoted-symbol-normal"/>
|
1364
|
+
<context ref="single-quoted-symbol-square"/>
|
1365
|
+
<context ref="single-quoted-symbol-angle"/>
|
1366
|
+
<context ref="single-quoted-symbol-generic"/>
|
1367
|
+
|
1368
|
+
<context ref="double-quoted-string"/>
|
1369
|
+
<context ref="double-quoted-string-curly"/>
|
1370
|
+
<context ref="double-quoted-string-normal"/>
|
1371
|
+
<context ref="double-quoted-string-square"/>
|
1372
|
+
<context ref="double-quoted-string-angle"/>
|
1373
|
+
<context ref="double-quoted-string-generic"/>
|
1374
|
+
<context ref="single-quoted-string"/>
|
1375
|
+
<context ref="single-quoted-string-curly"/>
|
1376
|
+
<context ref="single-quoted-string-normal"/>
|
1377
|
+
<context ref="single-quoted-string-square"/>
|
1378
|
+
<context ref="single-quoted-string-angle"/>
|
1379
|
+
<context ref="single-quoted-string-generic"/>
|
1380
|
+
|
1381
|
+
<context ref="double-quoted-word-array-curly"/>
|
1382
|
+
<context ref="double-quoted-word-array-normal"/>
|
1383
|
+
<context ref="double-quoted-word-array-square"/>
|
1384
|
+
<context ref="double-quoted-word-array-angle"/>
|
1385
|
+
<context ref="double-quoted-word-array-generic"/>
|
1386
|
+
<context ref="single-quoted-word-array-curly"/>
|
1387
|
+
<context ref="single-quoted-word-array-normal"/>
|
1388
|
+
<context ref="single-quoted-word-array-square"/>
|
1389
|
+
<context ref="single-quoted-word-array-angle"/>
|
1390
|
+
<context ref="single-quoted-word-array-generic"/>
|
1391
|
+
|
1392
|
+
<context ref="backtick-quoted-string"/>
|
1393
|
+
<context ref="backtick-quoted-string-curly"/>
|
1394
|
+
<context ref="backtick-quoted-string-normal"/>
|
1395
|
+
<context ref="backtick-quoted-string-square"/>
|
1396
|
+
<context ref="backtick-quoted-string-angle"/>
|
1397
|
+
<context ref="backtick-quoted-string-generic"/>
|
1398
|
+
|
1399
|
+
<context ref="regex"/>
|
1400
|
+
<context ref="regex-curly"/>
|
1401
|
+
<context ref="regex-normal"/>
|
1402
|
+
<context ref="regex-square"/>
|
1403
|
+
<context ref="regex-angle"/>
|
1404
|
+
<context ref="regex-generic"/>
|
1405
|
+
|
1406
|
+
<context ref="function"/>
|
1407
|
+
|
1408
|
+
<context ref="special-variables"/>
|
1409
|
+
<context ref="global-variables"/>
|
1410
|
+
|
1411
|
+
<context ref="ternary-operators"/>
|
1412
|
+
<context ref="hash-symbols"/>
|
1413
|
+
|
1414
|
+
<context ref="keywords"/>
|
1415
|
+
<context ref="important-methods"/>
|
1416
|
+
<context ref="special-values"/>
|
1417
|
+
|
1418
|
+
<context ref="important-constants"/>
|
1419
|
+
<context ref="constants"/>
|
1420
|
+
|
1421
|
+
<context ref="class-variables"/>
|
1422
|
+
<context ref="instance-variables"/>
|
1423
|
+
|
1424
|
+
<context ref="float"/>
|
1425
|
+
<context ref="integer"/>
|
1426
|
+
<context ref="hex"/>
|
1427
|
+
<context ref="octal"/>
|
1428
|
+
<context ref="binary"/>
|
1429
|
+
|
1430
|
+
<context ref="block-parameters"/>
|
1431
|
+
<context ref="hash"/>
|
1432
|
+
<context ref="array"/>
|
1433
|
+
<context ref="brackets"/>
|
1434
|
+
|
1435
|
+
<context ref="errors"/>
|
1436
|
+
|
1437
|
+
<context ref="collection-chars"/>
|
1438
|
+
<context ref="lambdas"/>
|
1439
|
+
<context ref="operators"/>
|
1440
|
+
<context ref="syntax-chars"/>
|
1441
|
+
|
1442
|
+
<context ref="methods"/>
|
1443
|
+
|
1444
|
+
<context ref="question-mark-string"/>
|
1445
|
+
|
1446
|
+
</include>
|
1447
|
+
</context>
|
1448
|
+
</definitions>
|
1449
|
+
</language>
|