| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY name "[A-Za-z_:][\w.:_-]*"> |
| 5 |
<!ENTITY entref "&(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> |
| 6 |
]> |
| 7 |
|
| 8 |
<!-- |
| 9 |
RHTML syntax highlighting definition for Kate. It combines the ruby and |
| 10 |
html syntax grammars. Some ideas, and the list of Rails method names were |
| 11 |
taken from an rhtml kate grammar for Quanta based on earlier versions of |
| 12 |
the syntax highlighters. |
| 13 |
|
| 14 |
Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi) |
| 15 |
Copyright (C) 2004 by Stefan Lang ([email protected]) |
| 16 |
Copyright (C) 2006 by Wilbert Berendsen ([email protected] |
| 17 |
Copyright (C) 2005 by Chris Martin ([email protected] |
| 18 |
Copyright (C) 2006 by Richard Dale ([email protected]) |
| 19 |
|
| 20 |
This library is free software; you can redistribute it and/or |
| 21 |
modify it under the terms of the GNU Library General Public |
| 22 |
License as published by the Free Software Foundation; either |
| 23 |
version 2 of the License, or (at your option) any later version. |
| 24 |
|
| 25 |
This library is distributed in the hope that it will be useful, |
| 26 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 27 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 28 |
Library General Public License for more details. |
| 29 |
|
| 30 |
You should have received a copy of the GNU Library General Public |
| 31 |
License along with this library; if not, write to the |
| 32 |
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 33 |
Boston, MA 02110-1301, USA. |
| 34 |
--> |
| 35 |
|
| 36 |
<!-- |
| 37 |
TODO: * Regular expressions spanning over multiple lines |
| 38 |
work only if newlines are escaped. |
| 39 |
* "Nested" HERE documents aren't recognized. |
| 40 |
* Division is detected correctly only, if whitespace |
| 41 |
is around the "/" operator. |
| 42 |
E.g.: detected correctly: 1 / 2 |
| 43 |
"/" interpreted as regex start: 1/2 |
| 44 |
--> |
| 45 |
|
| 46 |
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> |
| 47 |
<language name="Ruby/Rails/RHTML" version="14" kateversion="5.63" section="Markup" extensions="*.rhtml;*.RHTML;*.html.erb" mimetype="" author="Richard Dale [email protected]" license="LGPLv2+"> |
| 48 |
|
| 49 |
<highlighting> |
| 50 |
|
| 51 |
<list name="keywords"> |
| 52 |
<item>BEGIN</item> |
| 53 |
<item>END</item> |
| 54 |
<item>and</item> |
| 55 |
<item>begin</item> |
| 56 |
<item>break</item> |
| 57 |
<item>case</item> |
| 58 |
<item>defined?</item> |
| 59 |
<item>do</item> |
| 60 |
<item>else</item> |
| 61 |
<item>elsif</item> |
| 62 |
<item>end</item> |
| 63 |
<item>ensure</item> |
| 64 |
<item>for</item> |
| 65 |
<item>if</item> |
| 66 |
<item>in</item> |
| 67 |
<item>include</item> |
| 68 |
<item>next</item> |
| 69 |
<item>not</item> |
| 70 |
<item>or</item> |
| 71 |
<item>redo</item> |
| 72 |
<item>rescue</item> |
| 73 |
<item>retry</item> |
| 74 |
<item>return</item> |
| 75 |
<item>then</item> |
| 76 |
<item>unless</item> |
| 77 |
<item>until</item> |
| 78 |
<item>when</item> |
| 79 |
<item>while</item> |
| 80 |
<item>yield</item> |
| 81 |
</list> |
| 82 |
|
| 83 |
<list name="access-control"> |
| 84 |
<item>private_class_method</item> |
| 85 |
<item>private</item> |
| 86 |
<item>protected</item> |
| 87 |
<item>public_class_method</item> |
| 88 |
<item>public</item> |
| 89 |
</list> |
| 90 |
|
| 91 |
<list name="attribute-definitions"> |
| 92 |
<item>attr_reader</item> |
| 93 |
<item>attr_writer</item> |
| 94 |
<item>attr_accessor</item> |
| 95 |
</list> |
| 96 |
|
| 97 |
<list name="definitions"> |
| 98 |
<item>alias</item> |
| 99 |
<item>module</item> |
| 100 |
<item>class</item> |
| 101 |
<item>def</item> |
| 102 |
<item>undef</item> |
| 103 |
</list> |
| 104 |
|
| 105 |
<list name="pseudo-variables"> |
| 106 |
<item>self</item> |
| 107 |
<item>super</item> |
| 108 |
<item>nil</item> |
| 109 |
<item>false</item> |
| 110 |
<item>true</item> |
| 111 |
<item>caller</item> |
| 112 |
<item>__FILE__</item> |
| 113 |
<item>__LINE__</item> |
| 114 |
</list> |
| 115 |
|
| 116 |
<list name="default-globals"> |
| 117 |
<item>$stdout</item> |
| 118 |
<item>$defout</item> |
| 119 |
<item>$stderr</item> |
| 120 |
<item>$deferr</item> |
| 121 |
<item>$stdin</item> |
| 122 |
</list> |
| 123 |
|
| 124 |
<!-- Kernel module methods. |
| 125 |
NOTE: Methods ending in ? or ! |
| 126 |
are included below as regexes. |
| 127 |
--> |
| 128 |
<list name="kernel-methods"> |
| 129 |
<!-- backquote ` --> |
| 130 |
<item>abort</item> |
| 131 |
<item>at_exit</item> |
| 132 |
<item>autoload</item> |
| 133 |
<item>autoload?</item> |
| 134 |
<item>binding</item> |
| 135 |
<item>block_given?</item> |
| 136 |
<item>callcc</item> |
| 137 |
<item>caller</item> |
| 138 |
<item>catch</item> |
| 139 |
<item>chomp</item> |
| 140 |
<item>chomp!</item> |
| 141 |
<item>chop</item> |
| 142 |
<item>chop!</item> |
| 143 |
<item>eval</item> |
| 144 |
<item>exec</item> |
| 145 |
<item>exit</item> |
| 146 |
<item>exit!</item> |
| 147 |
<item>fail</item> |
| 148 |
<item>fork</item> |
| 149 |
<item>format</item> |
| 150 |
<item>getc</item> |
| 151 |
<item>gets</item> |
| 152 |
<item>global_variables</item> |
| 153 |
<item>gsub</item> |
| 154 |
<item>gsub!</item> |
| 155 |
<item>iterator?</item> |
| 156 |
<item>lambda</item> |
| 157 |
<item>load</item> |
| 158 |
<item>local_variables</item> |
| 159 |
<item>loop</item> |
| 160 |
<item>method_missing</item> |
| 161 |
<item>open</item> |
| 162 |
<item>p</item> |
| 163 |
<item>print</item> |
| 164 |
<item>printf</item> |
| 165 |
<item>proc</item> |
| 166 |
<item>putc</item> |
| 167 |
<item>puts</item> |
| 168 |
<item>raise</item> |
| 169 |
<item>rand</item> |
| 170 |
<item>readline</item> |
| 171 |
<item>readlines</item> |
| 172 |
<item>require</item> |
| 173 |
<item>scan</item> |
| 174 |
<item>select</item> |
| 175 |
<item>set_trace_func</item> |
| 176 |
<item>sleep</item> |
| 177 |
<item>split</item> |
| 178 |
<item>sprintf</item> |
| 179 |
<item>srand</item> |
| 180 |
<item>sub</item> |
| 181 |
<item>sub!</item> |
| 182 |
<item>syscall</item> |
| 183 |
<item>system</item> |
| 184 |
<item>test</item> |
| 185 |
<item>throw</item> |
| 186 |
<item>trace_var</item> |
| 187 |
<item>trap</item> |
| 188 |
<item>untrace_var</item> |
| 189 |
<item>warn</item> |
| 190 |
|
| 191 |
<!-- ActionView methods from Rails docs --> |
| 192 |
<item>auto_complete_field</item> |
| 193 |
<item>auto_complete_result</item> |
| 194 |
<item>auto_discovery_link_tag</item> |
| 195 |
<item>auto_link</item> |
| 196 |
<item>benchmark</item> |
| 197 |
<item>button_to</item> |
| 198 |
<item>cache</item> |
| 199 |
<item>capture</item> |
| 200 |
<item>check_box</item> |
| 201 |
<item>check_box_tag</item> |
| 202 |
<item>collection_select</item> |
| 203 |
<item>concat</item> |
| 204 |
<item>content_for</item> |
| 205 |
<item>content_tag</item> |
| 206 |
<item>country_options_for_select</item> |
| 207 |
<item>country_select</item> |
| 208 |
<item>current_page?</item> |
| 209 |
<item>date_select</item> |
| 210 |
<item>datetime_select</item> |
| 211 |
<item>debug</item> |
| 212 |
<item>define_javascript_functions</item> |
| 213 |
<item>distance_of_time_in_words</item> |
| 214 |
<item>distance_of_time_in_words_to_now</item> |
| 215 |
<item>draggable_element</item> |
| 216 |
<item>drop_receiving_element</item> |
| 217 |
<item>end_form_tag</item> |
| 218 |
<item>error_message_on</item> |
| 219 |
<item>error_messages_for</item> |
| 220 |
<item>escape_javascript</item> |
| 221 |
<item>evaluate_remote_response</item> |
| 222 |
<item>excerpt</item> |
| 223 |
<item>file_field</item> |
| 224 |
<item>file_field_tag</item> |
| 225 |
<item>finish_upload_status</item> |
| 226 |
<item>form</item> |
| 227 |
<item>form_remote_tag</item> |
| 228 |
<item>form_tag</item> |
| 229 |
<item>form_tag_with_upload_progress</item> |
| 230 |
<item>h</item> |
| 231 |
<item>hidden_field</item> |
| 232 |
<item>hidden_field_tag</item> |
| 233 |
<item>highlight</item> |
| 234 |
<item>human_size</item> |
| 235 |
<item>image_path</item> |
| 236 |
<item>image_submit_tag</item> |
| 237 |
<item>image_tag</item> |
| 238 |
<item>input</item> |
| 239 |
<item>javascript_include_tag</item> |
| 240 |
<item>javascript_path</item> |
| 241 |
<item>javascript_tag</item> |
| 242 |
<item>link_image_to</item> |
| 243 |
<item>link_to</item> |
| 244 |
<item>link_to_function</item> |
| 245 |
<item>link_to_if</item> |
| 246 |
<item>link_to_image</item> |
| 247 |
<item>link_to_remote</item> |
| 248 |
<item>link_to_unless</item> |
| 249 |
<item>link_to_unless_current</item> |
| 250 |
<item>mail_to</item> |
| 251 |
<item>markdown</item> |
| 252 |
<item>number_to_currency</item> |
| 253 |
<item>number_to_human_size</item> |
| 254 |
<item>number_to_percentage</item> |
| 255 |
<item>number_to_phone</item> |
| 256 |
<item>number_with_delimiter</item> |
| 257 |
<item>number_with_precision</item> |
| 258 |
<item>observe_field</item> |
| 259 |
<item>observe_form</item> |
| 260 |
<item>option_groups_from_collection_for_select</item> |
| 261 |
<item>options_for_select</item> |
| 262 |
<item>options_from_collection_for_select</item> |
| 263 |
<item>pagination_links</item> |
| 264 |
<item>password_field</item> |
| 265 |
<item>password_field_tag</item> |
| 266 |
<item>periodically_call_remote</item> |
| 267 |
<item>pluralize</item> |
| 268 |
<item>radio_button</item> |
| 269 |
<item>radio_button_tag</item> |
| 270 |
<item>register_template_handler</item> |
| 271 |
<item>render</item> |
| 272 |
<item>render_file</item> |
| 273 |
<item>render_template</item> |
| 274 |
<item>sanitize</item> |
| 275 |
<item>select</item> |
| 276 |
<item>select_date</item> |
| 277 |
<item>select_datetime</item> |
| 278 |
<item>select_day</item> |
| 279 |
<item>select_hour</item> |
| 280 |
<item>select_minute</item> |
| 281 |
<item>select_month</item> |
| 282 |
<item>select_second</item> |
| 283 |
<item>select_tag</item> |
| 284 |
<item>select_time</item> |
| 285 |
<item>select_year</item> |
| 286 |
<item>simple_format</item> |
| 287 |
<item>sortable_element</item> |
| 288 |
<item>start_form_tag</item> |
| 289 |
<item>strip_links</item> |
| 290 |
<item>stylesheet_link_tag</item> |
| 291 |
<item>stylesheet_path</item> |
| 292 |
<item>submit_tag</item> |
| 293 |
<item>submit_to_remote</item> |
| 294 |
<item>tag</item> |
| 295 |
<item>text_area</item> |
| 296 |
<item>text_area_tag</item> |
| 297 |
<item>text_field</item> |
| 298 |
<item>text_field_tag</item> |
| 299 |
<item>text_field_with_auto_complete</item> |
| 300 |
<item>textilize</item> |
| 301 |
<item>textilize_without_paragraph</item> |
| 302 |
<item>time_ago_in_words</item> |
| 303 |
<item>time_zone_options_for_select</item> |
| 304 |
<item>time_zone_select</item> |
| 305 |
<item>truncate</item> |
| 306 |
<item>update_element_function</item> |
| 307 |
<item>upload_progress_status</item> |
| 308 |
<item>upload_progress_text</item> |
| 309 |
<item>upload_progress_update_bar_js</item> |
| 310 |
<item>upload_status_progress_bar_tag</item> |
| 311 |
<item>upload_status_tag</item> |
| 312 |
<item>upload_status_text_tag</item> |
| 313 |
<item>url_for</item> |
| 314 |
<item>visual_effect</item> |
| 315 |
<item>word_wrap</item> |
| 316 |
</list> |
| 317 |
|
| 318 |
<contexts> |
| 319 |
|
| 320 |
<!-- BEGIN HTML contexts --> |
| 321 |
<context name="Start" attribute="Normal Text" lineEndContext="#stay"> |
| 322 |
<IncludeRules context="FindHTML" /> |
| 323 |
</context> |
| 324 |
|
| 325 |
<context name="FindHTML" attribute="Normal Text" lineEndContext="#stay"> |
| 326 |
<DetectSpaces/> |
| 327 |
<DetectIdentifier/> |
| 328 |
|
| 329 |
<IncludeRules context="find-rubysource" /> |
| 330 |
<DetectChar attribute="Ruby Source" context="rubysourceline" char="%" /> |
| 331 |
|
| 332 |
<StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> |
| 333 |
<StringDetect attribute="CDATA" context="CDATA" String="<![CDATA[" beginRegion="cdata" /> |
| 334 |
<RegExpr attribute="Doctype" context="Doctype" String="<!DOCTYPE\s+" beginRegion="doctype" /> |
| 335 |
<RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> |
| 336 |
<WordDetect attribute="Element" context="CSS" String="<style" insensitive="true" beginRegion="style" /> |
| 337 |
<WordDetect attribute="Element" context="JS" String="<script" insensitive="true" beginRegion="script" /> |
| 338 |
<WordDetect attribute="Element" context="El Open" String="<pre" insensitive="true" beginRegion="pre" /> |
| 339 |
<WordDetect attribute="Element" context="El Open" String="<div" insensitive="true" beginRegion="div" /> |
| 340 |
<WordDetect attribute="Element" context="El Open" String="<table" insensitive="true" beginRegion="table" /> |
| 341 |
<RegExpr attribute="Element" context="El Open" String="<&name;" /> |
| 342 |
<WordDetect attribute="Element" context="El Close" String="</pre" insensitive="true" endRegion="pre" /> |
| 343 |
<WordDetect attribute="Element" context="El Close" String="</div" insensitive="true" endRegion="div" /> |
| 344 |
<WordDetect attribute="Element" context="El Close" String="</table" insensitive="true" endRegion="table" /> |
| 345 |
<RegExpr attribute="Element" context="El Close" String="</&name;" /> |
| 346 |
<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" /> |
| 347 |
<IncludeRules context="FindEntityRefs" /> |
| 348 |
</context> |
| 349 |
|
| 350 |
<context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay"> |
| 351 |
<RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> |
| 352 |
<AnyChar attribute="Error" context="#stay" String="&<" /> |
| 353 |
</context> |
| 354 |
|
| 355 |
<context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay"> |
| 356 |
<RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> |
| 357 |
<RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" /> |
| 358 |
<AnyChar attribute="Error" context="#stay" String="&%" /> |
| 359 |
</context> |
| 360 |
|
| 361 |
<context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay"> |
| 362 |
<RegExpr attribute="Attribute" context="#stay" String="^&name;|\s+&name;" /> |
| 363 |
<DetectChar attribute="Attribute" context="Value" char="=" /> |
| 364 |
</context> |
| 365 |
|
| 366 |
<context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay"> |
| 367 |
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="<!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" /> |
| 368 |
</context> |
| 369 |
|
| 370 |
|
| 371 |
<context name="Comment" attribute="Comment" lineEndContext="#stay"> |
| 372 |
<DetectSpaces/> |
| 373 |
<StringDetect attribute="Comment" context="#pop" String="-->" endRegion="comment" /> |
| 374 |
<IncludeRules context="##Comments" /> |
| 375 |
<DetectIdentifier/> |
| 376 |
<RegExpr attribute="Error" context="#stay" String="-(-(?!->))+" /> |
| 377 |
</context> |
| 378 |
|
| 379 |
<context name="CDATA" attribute="Normal Text" lineEndContext="#stay"> |
| 380 |
<DetectSpaces/> |
| 381 |
<DetectIdentifier/> |
| 382 |
<StringDetect attribute="CDATA" context="#pop" String="]]>" endRegion="cdata" /> |
| 383 |
<StringDetect attribute="EntityRef" context="#stay" String="]]&gt;" /> |
| 384 |
</context> |
| 385 |
|
| 386 |
<context name="PI" attribute="Normal Text" lineEndContext="#stay"> |
| 387 |
<Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1=">" endRegion="pi" /> |
| 388 |
</context> |
| 389 |
|
| 390 |
<context name="Doctype" attribute="Normal Text" lineEndContext="#stay"> |
| 391 |
<DetectChar attribute="Doctype" context="#pop" char=">" endRegion="doctype" /> |
| 392 |
<DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" /> |
| 393 |
</context> |
| 394 |
|
| 395 |
<context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay"> |
| 396 |
<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" /> |
| 397 |
<IncludeRules context="FindDTDRules" /> |
| 398 |
<StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> |
| 399 |
<RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> |
| 400 |
<IncludeRules context="FindPEntityRefs" /> |
| 401 |
</context> |
| 402 |
|
| 403 |
<context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay"> |
| 404 |
<DetectChar attribute="Doctype" context="#pop" char=">" /> |
| 405 |
<DetectChar attribute="Value" context="Doctype Markupdecl DQ" char=""" /> |
| 406 |
<DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="'" /> |
| 407 |
</context> |
| 408 |
|
| 409 |
<context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay"> |
| 410 |
<IncludeRules context="find-rubysource" /> |
| 411 |
|
| 412 |
<DetectChar attribute="Value" context="#pop" char=""" /> |
| 413 |
<IncludeRules context="FindPEntityRefs" /> |
| 414 |
</context> |
| 415 |
|
| 416 |
<context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay"> |
| 417 |
<IncludeRules context="find-rubysource" /> |
| 418 |
|
| 419 |
<DetectChar attribute="Value" context="#pop" char="'" /> |
| 420 |
<IncludeRules context="FindPEntityRefs" /> |
| 421 |
</context> |
| 422 |
|
| 423 |
<context name="El Open" attribute="Normal Text" lineEndContext="#stay"> |
| 424 |
<IncludeRules context="find-rubysource" /> |
| 425 |
|
| 426 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" /> |
| 427 |
<DetectChar attribute="Element" context="#pop" char=">" /> |
| 428 |
<IncludeRules context="FindAttributes" /> |
| 429 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 430 |
</context> |
| 431 |
|
| 432 |
<context name="El Close" attribute="Normal Text" lineEndContext="#stay"> |
| 433 |
<IncludeRules context="find-rubysource" /> |
| 434 |
|
| 435 |
<DetectChar attribute="Element" context="#pop" char=">" /> |
| 436 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 437 |
</context> |
| 438 |
|
| 439 |
<context name="El Close 2" attribute="Normal Text" lineEndContext="#stay"> |
| 440 |
<IncludeRules context="find-rubysource" /> |
| 441 |
|
| 442 |
<DetectChar attribute="Element" context="#pop#pop#pop" char=">" /> |
| 443 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 444 |
</context> |
| 445 |
|
| 446 |
<context name="El Close 3" attribute="Normal Text" lineEndContext="#stay"> |
| 447 |
<IncludeRules context="find-rubysource" /> |
| 448 |
|
| 449 |
<DetectChar attribute="Element" context="#pop#pop#pop#pop" char=">" /> |
| 450 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 451 |
</context> |
| 452 |
|
| 453 |
<context name="CSS" attribute="Normal Text" lineEndContext="#stay"> |
| 454 |
<IncludeRules context="find-rubysource" /> |
| 455 |
|
| 456 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="style" /> |
| 457 |
<DetectChar attribute="Element" context="CSS content" char=">" /> |
| 458 |
<IncludeRules context="FindAttributes" /> |
| 459 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 460 |
</context> |
| 461 |
|
| 462 |
<context name="CSS content" attribute="Normal Text" lineEndContext="#stay"> |
| 463 |
<IncludeRules context="find-rubysource" /> |
| 464 |
|
| 465 |
<WordDetect attribute="Element" context="El Close 2" String="</style" insensitive="true" endRegion="style" /> |
| 466 |
<IncludeRules context="##CSS" includeAttrib="true"/> |
| 467 |
</context> |
| 468 |
|
| 469 |
<context name="JS" attribute="Normal Text" lineEndContext="#stay"> |
| 470 |
<IncludeRules context="find-rubysource" /> |
| 471 |
|
| 472 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="script" /> |
| 473 |
<DetectChar attribute="Element" context="JS content" char=">" /> |
| 474 |
<IncludeRules context="FindAttributes" /> |
| 475 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 476 |
</context> |
| 477 |
|
| 478 |
<context name="JS content" attribute="Normal Text" lineEndContext="#stay"> |
| 479 |
<IncludeRules context="find-rubysource" /> |
| 480 |
|
| 481 |
<WordDetect attribute="Element" context="El Close 2" String="</script" insensitive="true" endRegion="script" /> |
| 482 |
<RegExpr attribute="Comment" context="JS comment close" String="//(?=.*</script\b)" insensitive="true" /> |
| 483 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 484 |
</context> |
| 485 |
|
| 486 |
<context name="JS comment close" attribute="Comment" lineEndContext="#pop"> |
| 487 |
<RegExpr attribute="Element" context="El Close 3" String="</script\b" insensitive="true" endRegion="script" /> |
| 488 |
<IncludeRules context="##Comments" /> |
| 489 |
</context> |
| 490 |
|
| 491 |
<context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="Value NQ"> |
| 492 |
<IncludeRules context="find-rubysource" /> |
| 493 |
|
| 494 |
<DetectChar attribute="Value" context="Value DQ" char=""" /> |
| 495 |
<DetectChar attribute="Value" context="Value SQ" char="'" /> |
| 496 |
<DetectSpaces /> |
| 497 |
</context> |
| 498 |
|
| 499 |
<context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthroughContext="#pop#pop"> |
| 500 |
<IncludeRules context="find-rubysource" /> |
| 501 |
|
| 502 |
<IncludeRules context="FindEntityRefs" /> |
| 503 |
<RegExpr attribute="Value" context="#stay" String="/(?!>)|[^/><"'\s]" /> |
| 504 |
</context> |
| 505 |
|
| 506 |
<context name="Value DQ" attribute="Value" lineEndContext="#stay"> |
| 507 |
<IncludeRules context="find-rubysource" /> |
| 508 |
|
| 509 |
<DetectChar attribute="Value" context="#pop#pop" char=""" /> |
| 510 |
<IncludeRules context="FindEntityRefs" /> |
| 511 |
</context> |
| 512 |
|
| 513 |
<context name="Value SQ" attribute="Value" lineEndContext="#stay"> |
| 514 |
<IncludeRules context="find-rubysource" /> |
| 515 |
|
| 516 |
<DetectChar attribute="Value" context="#pop#pop" char="'" /> |
| 517 |
<IncludeRules context="FindEntityRefs" /> |
| 518 |
</context> |
| 519 |
<!-- END HTML contexts --> |
| 520 |
|
| 521 |
<!-- BEGIN Ruby contexts --> |
| 522 |
|
| 523 |
<!-- A single line of ruby source after a '%' ERB tag --> |
| 524 |
<context name="rubysourceline" attribute="RUBY RAILS ERB Text" lineEndContext="#pop"> |
| 525 |
<IncludeRules context="rubysource" /> |
| 526 |
</context> |
| 527 |
|
| 528 |
<context name="find-rubysource" attribute="Normal Text" lineEndContext="#stay"> |
| 529 |
<Detect2Chars attribute="Ruby Source" context="rubysource-markup" char="<" char1="%" /> |
| 530 |
</context> |
| 531 |
<context name="rubysource-markup" attribute="Ruby Source" lineEndContext="#pop!rubysource-block-content" fallthroughContext="#pop!rubysource-block-content"> |
| 532 |
<AnyChar attribute="Ruby Source" context="#pop!rubysource-block-content" String="=-" /> <!-- <%= and <%- --> |
| 533 |
</context> |
| 534 |
<context name="rubysource-block-content" attribute="RUBY RAILS ERB Text" lineEndContext="#stay"> |
| 535 |
<StringDetect attribute="Ruby Source" context="#pop" String="-%>" /> |
| 536 |
<Detect2Chars attribute="Ruby Source" context="#pop" char="%" char1=">" /> |
| 537 |
<IncludeRules context="rubysource" /> |
| 538 |
</context> |
| 539 |
|
| 540 |
<context name="rubysource" attribute="RUBY RAILS ERB Text" lineEndContext="#stay"> |
| 541 |
<!-- ruby ignores newline after \ --> |
| 542 |
<LineContinue attribute="Ruby Normal Text" context="Line Continue"/> |
| 543 |
|
| 544 |
<!-- __END__ token on own line. --> |
| 545 |
<RegExpr attribute="Keyword" String="^__END__$" context="DATA" column="0"/> |
| 546 |
|
| 547 |
<!-- "shebang" line --> |
| 548 |
<StringDetect attribute="Keyword" String="^#!/" context="ShebangLine" column="0"/> |
| 549 |
|
| 550 |
<!-- "def" - "end" blocks --> |
| 551 |
<!-- check for statement modifiers with regexes --> |
| 552 |
<RegExpr attribute="Keyword" String="(?:\=|\(|\[|\{)\s*(?:if|unless|while|until)\b" context="#stay" beginRegion="def block"/> |
| 553 |
<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/> |
| 554 |
<RegExpr attribute="Keyword" String="\;\s*(?:while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> |
| 555 |
<WordDetect attribute="Keyword" String="if" context="#stay" beginRegion="def block" firstNonSpace="true"/> |
| 556 |
<WordDetect attribute="Keyword" String="unless" context="#stay" beginRegion="def block" firstNonSpace="true"/> |
| 557 |
<RegExpr attribute="Keyword" String="\;\s*(?:if|unless)\b" context="#stay" beginRegion="def block"/> |
| 558 |
<WordDetect attribute="Keyword" String="class" context="#stay" beginRegion="def block"/> |
| 559 |
<WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/> |
| 560 |
<WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/> |
| 561 |
<RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> |
| 562 |
<WordDetect attribute="Keyword" String="case" context="#stay" beginRegion="def block"/> |
| 563 |
<WordDetect attribute="Keyword" String="do" context="#stay" beginRegion="def block"/> |
| 564 |
<WordDetect attribute="Keyword" String="def" context="#stay" beginRegion="def block"/> |
| 565 |
<WordDetect attribute="Keyword" String="end" context="#stay" endRegion="def block"/> |
| 566 |
<!-- elsif/else close the current block and start a new one --> |
| 567 |
<RegExpr attribute="Keyword" String="(?:\b|^\s*)(?:else|elsif|rescue|ensure)(?:\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/> |
| 568 |
|
| 569 |
<StringDetect attribute="Operator" String="..." context="#stay"/> |
| 570 |
<Detect2Chars attribute="Operator" char="." char1="." context="#stay"/> |
| 571 |
|
| 572 |
<!-- marks a message (being sent, not defined) --> |
| 573 |
<RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(?:\?|\!|\b)" context="#stay"/> |
| 574 |
|
| 575 |
<!-- Check for "ASCII code operator". e.g.: ?a --> |
| 576 |
<RegExpr attribute="Dec" String="\s\?(?:\\M\-)?(?:\\C\-)?\\?\S" context="#stay"/> |
| 577 |
|
| 578 |
<keyword attribute="Keyword" String="keywords" context="#stay"/> |
| 579 |
<keyword attribute="Attribute Definition" String="attribute-definitions" context="#stay"/> |
| 580 |
<keyword attribute="Access Control" String="access-control" context="#stay"/> |
| 581 |
<keyword attribute="Definition" String="definitions" context="#stay" /> |
| 582 |
<keyword attribute="Pseudo variable" String="pseudo-variables" context="#stay"/> |
| 583 |
<keyword attribute="Default globals" String="default-globals" context="#stay"/> |
| 584 |
<keyword attribute="Kernel methods" String="kernel-methods" context="#stay"/> |
| 585 |
|
| 586 |
<!-- (global) vars starting with $ |
| 587 |
Match them before $_. |
| 588 |
--> |
| 589 |
<RegExpr attribute="Global Variable" String="\$(?:\w+|\-[a-zA-Z_]\b)" context="#stay"/> |
| 590 |
<!-- special-character globals --> |
| 591 |
<RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&]" context="#stay"/> |
| 592 |
<RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/> |
| 593 |
<!-- Generally a module or class name like "File", "MyModule_1", .. --> |
| 594 |
<RegExpr attribute="Constant" String="\b[A-Z]+_*(?:[0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/> |
| 595 |
|
| 596 |
<RegExpr attribute="Hex" String="(?:\-|\b)0[xX][_0-9a-fA-F]+" context="#stay"/> |
| 597 |
<RegExpr attribute="Bin" String="(?:\-|\b)0[bB][_01]+" context="#stay"/> |
| 598 |
<RegExpr attribute="Octal" String="(?:\-|\b)0[1-7][_0-7]*" context="#stay"/> |
| 599 |
<RegExpr attribute="Float" String="(?:\-|\b)[0-9][0-9_]*\.[0-9][0-9_]*(?:[eE]\-?[1-9][0-9]*(?:\.[0-9]*)?)?" context="#stay"/> |
| 600 |
<RegExpr attribute="Dec" String="(?:\-|\b)[1-9][0-9_]*\b" context="#stay"/> |
| 601 |
<Int attribute="Dec" context="#stay"/> |
| 602 |
<HlCChar attribute="Char" context="#stay"/> |
| 603 |
|
| 604 |
<!-- Check for =begin before assignment operator. --> |
| 605 |
<StringDetect attribute="Blockcomment" String="=begin" context="Embedded documentation" beginRegion="comment block" column="0"/> |
| 606 |
|
| 607 |
<!-- recognize the beginning of a HEREDOC |
| 608 |
This uses new features in Kate 2.3 and later |
| 609 |
|
| 610 |
There is no other chance of keeping heredoc apart from the |
| 611 |
push operator '<<' than requiring to put space between the operator |
| 612 |
and the string. |
| 613 |
--> |
| 614 |
<RegExpr attribute="Operator" context="find_indented_heredoc" String="\s*<<-(?=\w+|["'])" beginRegion="HereDocument" /> |
| 615 |
<RegExpr attribute="Operator" context="find_heredoc" String="\s*<<(?=\w+|["'])" beginRegion="HereDocument" /> |
| 616 |
|
| 617 |
<DetectChar attribute="Operator" char="." context="#stay"/> |
| 618 |
<Detect2Chars attribute="Operator" char="&" char1="&" context="#stay"/> |
| 619 |
<Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/> |
| 620 |
<!-- \s! is regexp hack --> |
| 621 |
<RegExpr attribute="Operator" String="\s[\?\:\%/]\s|[|&<>\^\+*~\-=]+|\s!|/=\s" context="#stay"/> |
| 622 |
<Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/> |
| 623 |
<Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/> |
| 624 |
|
| 625 |
<RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="#stay"/> |
| 626 |
|
| 627 |
<DetectChar attribute="String" char=""" context="Quoted String"/> |
| 628 |
<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/> |
| 629 |
<DetectChar attribute="Command" char="`" context="Command String"/> |
| 630 |
|
| 631 |
<Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/> |
| 632 |
|
| 633 |
<RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/> |
| 634 |
<RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/> |
| 635 |
<DetectChar attribute="Comment" char="#" context="Comment Line" firstNonSpace="true"/> |
| 636 |
<RegExpr attribute="Comment" String="\s#" context="General Comment"/> |
| 637 |
|
| 638 |
<RegExpr attribute="Delimiter" String="[\[\]]+" context="#stay"/> |
| 639 |
<DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/> |
| 640 |
<DetectChar attribute="Delimiter" char="}" context="#stay" endRegion="def block"/> |
| 641 |
|
| 642 |
<RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="#stay"/> |
| 643 |
<RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="#stay"/> |
| 644 |
|
| 645 |
<!-- handle the different regular expression formats --> |
| 646 |
<DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/> |
| 647 |
|
| 648 |
<!-- recognize the beginning of a general delimited input format --> |
| 649 |
<!-- this moves to the next context to separate out the exact nature of the GDL input --> |
| 650 |
<RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s>])" beginRegion="GdlInput" /> |
| 651 |
</context> |
| 652 |
|
| 653 |
<context name="ShebangLine" attribute="Keyword" lineEndContext="#pop" /> |
| 654 |
|
| 655 |
<context name="Line Continue" attribute="Ruby Normal Text" lineEndContext="#pop"> |
| 656 |
<RegExpr attribute="Keyword" String="(?:while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/> |
| 657 |
<WordDetect attribute="Keyword" String="if" context="#stay" firstNonSpace="true"/> |
| 658 |
<WordDetect attribute="Keyword" String="unless" context="#stay" firstNonSpace="true"/> |
| 659 |
<IncludeRules context="rubysource"/> |
| 660 |
</context> |
| 661 |
|
| 662 |
<context name="Quoted String" attribute="String" lineEndContext="#stay"> |
| 663 |
<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> |
| 664 |
<Detect2Chars attribute="String" char="\" char1=""" context="#stay"/> |
| 665 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 666 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 667 |
<!--HlCChar attribute="Char" context="#pop"/--> |
| 668 |
<DetectChar char=""" attribute="String" context="#pop"/> |
| 669 |
</context> |
| 670 |
|
| 671 |
<context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay"> |
| 672 |
<!-- <HlCChar attribute="Char" context="#pop"/> --> |
| 673 |
<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> |
| 674 |
<Detect2Chars attribute="String" char="\" char1="'" context="#stay"/> |
| 675 |
<DetectChar char="'" attribute="Raw String" context="#pop"/> |
| 676 |
</context> |
| 677 |
|
| 678 |
<context name="Command String" attribute="Command" lineEndContext="#stay"> |
| 679 |
<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> |
| 680 |
<Detect2Chars attribute="String" char="\" char1="`" context="#stay"/> |
| 681 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 682 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 683 |
<HlCChar attribute="Char" context="#pop"/> |
| 684 |
<DetectChar char="`" attribute="Command" context="#pop"/> |
| 685 |
</context> |
| 686 |
|
| 687 |
<context name="Embedded documentation" attribute="Ruby Comment" lineEndContext="#stay"> |
| 688 |
<StringDetect attribute="Ruby Comment" String="=end" context="#pop" endRegion="comment block" column="0"/> |
| 689 |
</context> |
| 690 |
|
| 691 |
<context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay"> |
| 692 |
<Detect2Chars attribute="Regular Expression" char="\" char1="/" context="#stay"/> |
| 693 |
<RegExpr attribute="Regular Expression" String="[^\\]$" context="#pop"/> |
| 694 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 695 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 696 |
<RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="#pop"/> |
| 697 |
</context> |
| 698 |
|
| 699 |
<!-- Substitutions can be nested --> |
| 700 |
<context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay"> |
| 701 |
<DetectChar attribute="Substitution" char="}" context="#pop"/> |
| 702 |
<!-- Highlight substitution as code. --> |
| 703 |
<IncludeRules context="rubysource"/> |
| 704 |
</context> |
| 705 |
|
| 706 |
<context name="Short Subst" attribute="Substitution" lineEndContext="#pop"> |
| 707 |
<!-- Check for e.g.: "#@var#@@xy" --> |
| 708 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/> |
| 709 |
<RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/> |
| 710 |
</context> |
| 711 |
|
| 712 |
<!-- This handles access of nested module classes and class methods --> |
| 713 |
<context name="Member Access" attribute="Member" lineEndContext="#pop"> |
| 714 |
<!-- marks a message (being sent, not defined) --> |
| 715 |
<RegExpr attribute="Message" String="\.?[_a-z]\w*[\?\!]?(?=[^\w\d\.\:])" context="#pop"/> |
| 716 |
<RegExpr attribute="Message" String="\.?[_a-z]\w*[\?\!]?" context="#stay"/> |
| 717 |
<RegExpr attribute="Constant" String="[A-Z]+_*[\da-z]\w*(?=[^\w\d\.\:])" context="#pop"/> |
| 718 |
<RegExpr attribute="Constant" String="[A-Z]+_*[0-9a-z]\w*" context="#stay"/> |
| 719 |
<RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" context="#pop"/> |
| 720 |
<RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" context="#stay"/> |
| 721 |
<Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/> |
| 722 |
<DetectChar attribute="Member" char="." context="#stay"/> |
| 723 |
|
| 724 |
<AnyChar attribute="Operator" String="=+-*/%|&[]{}~" context="#pop"/> |
| 725 |
<DetectChar attribute="Ruby Comment" char="#" context="#pop"/> |
| 726 |
<AnyChar attribute="Ruby Normal Text" String="()\" context="#pop"/> |
| 727 |
<RegExpr attribute="Member" String="\W" context="#pop"/> |
| 728 |
</context> |
| 729 |
|
| 730 |
<context name="Comment Line" attribute="Ruby Comment" lineEndContext="#pop"> |
| 731 |
<DetectSpaces /> |
| 732 |
<StringDetect context="#pop" String="-%>" lookAhead="true" /> |
| 733 |
<Detect2Chars context="#pop" char="%" char1=">" lookAhead="true" /> |
| 734 |
<RegExpr attribute="Ruby Comment" String="\w\:\:\s" context="RDoc Label"/> |
| 735 |
<IncludeRules context="##Comments"/> |
| 736 |
</context> |
| 737 |
|
| 738 |
<context name="General Comment" attribute="Ruby Comment" lineEndContext="#pop"> |
| 739 |
<DetectSpaces/> |
| 740 |
<IncludeRules context="##Comments"/> |
| 741 |
</context> |
| 742 |
|
| 743 |
<context name="RDoc Label" attribute="RDoc Value" lineEndContext="#pop"/> |
| 744 |
|
| 745 |
<!-- HEREDOC support |
| 746 |
The contexts below support both normal and indented heredocs |
| 747 |
--> |
| 748 |
<!-- here we markup the heredoc markers --> |
| 749 |
<context name="find_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" > |
| 750 |
<RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" /> |
| 751 |
<RegExpr attribute="Keyword" context="normal_heredoc" String=""?(\w+)"?" /> |
| 752 |
</context> |
| 753 |
<context name="find_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" > |
| 754 |
<RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" /> |
| 755 |
<RegExpr attribute="Keyword" context="indented_heredoc" String=""?(\w+)"?" /> |
| 756 |
</context> |
| 757 |
<!-- these are the real heredoc contexts --> |
| 758 |
<context name="indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true"> |
| 759 |
<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>--> |
| 760 |
<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/> |
| 761 |
<IncludeRules context="heredoc_rules" /> |
| 762 |
</context> |
| 763 |
<context name="apostrophed_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true"> |
| 764 |
<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>--> |
| 765 |
<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/> |
| 766 |
</context> |
| 767 |
|
| 768 |
<context name="normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true"> |
| 769 |
<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>--> |
| 770 |
<RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/> |
| 771 |
<IncludeRules context="heredoc_rules" /> |
| 772 |
</context> |
| 773 |
<context name="apostrophed_normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true"> |
| 774 |
<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>--> |
| 775 |
<RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/> |
| 776 |
</context> |
| 777 |
|
| 778 |
<!-- rules for heredoc types --> |
| 779 |
<context name="heredoc_rules" attribute="Ruby Normal Text" lineEndContext="#stay"> |
| 780 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 781 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 782 |
</context> |
| 783 |
|
| 784 |
<!-- General delimited input support |
| 785 |
The contexts below handle the various gdl formats |
| 786 |
--> |
| 787 |
<context name="find_gdl_input" attribute="Ruby Normal Text" lineEndContext="#pop"> |
| 788 |
|
| 789 |
<!-- handle token arrays --> |
| 790 |
<Detect2Chars attribute="GDL input" context="gdl_token_array_1" char="w" char1="(" /> |
| 791 |
<Detect2Chars attribute="GDL input" context="gdl_token_array_2" char="w" char1="{" /> |
| 792 |
<Detect2Chars attribute="GDL input" context="gdl_token_array_3" char="w" char1="[" /> |
| 793 |
<Detect2Chars attribute="GDL input" context="gdl_token_array_4" char="w" char1="<" /> |
| 794 |
<!-- then we handle the 'any char' format --> |
| 795 |
<RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" /> |
| 796 |
|
| 797 |
<!-- handle apostrophed strings --> |
| 798 |
<Detect2Chars attribute="GDL input" context="gdl_apostrophed_1" char="q" char1="(" /> |
| 799 |
<Detect2Chars attribute="GDL input" context="gdl_apostrophed_2" char="q" char1="{" /> |
| 800 |
<Detect2Chars attribute="GDL input" context="gdl_apostrophed_3" char="q" char1="[" /> |
| 801 |
<Detect2Chars attribute="GDL input" context="gdl_apostrophed_4" char="q" char1="<" /> |
| 802 |
<!-- then we handle the 'any char' format --> |
| 803 |
<RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" /> |
| 804 |
|
| 805 |
<!-- handle shell commands --> |
| 806 |
<Detect2Chars attribute="GDL input" context="gdl_shell_command_1" char="x" char1="(" /> |
| 807 |
<Detect2Chars attribute="GDL input" context="gdl_shell_command_2" char="x" char1="{" /> |
| 808 |
<Detect2Chars attribute="GDL input" context="gdl_shell_command_3" char="x" char1="[" /> |
| 809 |
<Detect2Chars attribute="GDL input" context="gdl_shell_command_4" char="x" char1="<" /> |
| 810 |
<!-- then we handle the 'any char' format --> |
| 811 |
<RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" /> |
| 812 |
|
| 813 |
<!-- handle regular expressions --> |
| 814 |
<Detect2Chars attribute="GDL input" context="gdl_regexpr_1" char="r" char1="(" /> |
| 815 |
<Detect2Chars attribute="GDL input" context="gdl_regexpr_2" char="r" char1="{" /> |
| 816 |
<Detect2Chars attribute="GDL input" context="gdl_regexpr_3" char="r" char1="[" /> |
| 817 |
<Detect2Chars attribute="GDL input" context="gdl_regexpr_4" char="r" char1="<" /> |
| 818 |
<!-- then we handle the 'any char' format --> |
| 819 |
<RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" /> |
| 820 |
|
| 821 |
<!-- handle double-quoted strings --> |
| 822 |
<!-- |
| 823 |
be careful to make this the last GDL ruleset, because the rule for |
| 824 |
the short form %?foo? will otherwise catch any of the other formats |
| 825 |
--> |
| 826 |
<Detect2Chars attribute="GDL input" context="gdl_dq_string_1" char="Q" char1="(" /> |
| 827 |
<Detect2Chars attribute="GDL input" context="gdl_dq_string_2" char="Q" char1="{" /> |
| 828 |
<Detect2Chars attribute="GDL input" context="gdl_dq_string_3" char="Q" char1="[" /> |
| 829 |
<Detect2Chars attribute="GDL input" context="gdl_dq_string_4" char="Q" char1="<" /> |
| 830 |
<DetectChar attribute="GDL input" context="gdl_dq_string_1" char="(" /> |
| 831 |
<DetectChar attribute="GDL input" context="gdl_dq_string_2" char="{" /> |
| 832 |
<DetectChar attribute="GDL input" context="gdl_dq_string_3" char="[" /> |
| 833 |
<DetectChar attribute="GDL input" context="gdl_dq_string_4" char="<" /> |
| 834 |
<!-- then we handle the 'any char' format --> |
| 835 |
<RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" /> |
| 836 |
|
| 837 |
</context> |
| 838 |
<!-- double-quoted string specific contexts follow --> |
| 839 |
<context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" > |
| 840 |
<IncludeRules context="dq_string_rules" /> |
| 841 |
<Detect2Chars attribute="String" char="\" char1=")" context="#stay"/> |
| 842 |
<DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" /> |
| 843 |
<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" /> |
| 844 |
</context> |
| 845 |
<context name="gdl_dq_string_1_nested" attribute="String" lineEndContext="#stay" > |
| 846 |
<IncludeRules context="dq_string_rules" /> |
| 847 |
<DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" /> |
| 848 |
<DetectChar attribute="String" context="#pop" char=")" /> |
| 849 |
</context> |
| 850 |
<!-- note that here substitution should win over nesting --> |
| 851 |
<context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" > |
| 852 |
<IncludeRules context="dq_string_rules" /> |
| 853 |
<Detect2Chars attribute="String" char="\" char1="}" context="#stay"/> |
| 854 |
<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" /> |
| 855 |
<DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" /> |
| 856 |
</context> |
| 857 |
<context name="gdl_dq_string_2_nested" attribute="String" lineEndContext="#stay" > |
| 858 |
<DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" /> |
| 859 |
<DetectChar attribute="String" context="#pop" char="}" /> |
| 860 |
<IncludeRules context="dq_string_rules" /> |
| 861 |
</context> |
| 862 |
|
| 863 |
<context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" > |
| 864 |
<IncludeRules context="dq_string_rules" /> |
| 865 |
<Detect2Chars attribute="String" char="\" char1="]" context="#stay"/> |
| 866 |
<DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" /> |
| 867 |
<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" /> |
| 868 |
</context> |
| 869 |
<context name="gdl_dq_string_3_nested" attribute="String" lineEndContext="#stay" > |
| 870 |
<DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" /> |
| 871 |
<DetectChar attribute="String" context="#pop" char="]" /> |
| 872 |
<IncludeRules context="dq_string_rules" /> |
| 873 |
</context> |
| 874 |
|
| 875 |
<context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" > |
| 876 |
<IncludeRules context="dq_string_rules" /> |
| 877 |
<Detect2Chars attribute="String" char="\" char1=">" context="#stay"/> |
| 878 |
<DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" /> |
| 879 |
<DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" /> |
| 880 |
</context> |
| 881 |
<context name="gdl_dq_string_4_nested" attribute="String" lineEndContext="#stay" > |
| 882 |
<DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" /> |
| 883 |
<DetectChar attribute="String" context="#pop" char=">" /> |
| 884 |
<IncludeRules context="dq_string_rules" /> |
| 885 |
</context> |
| 886 |
|
| 887 |
<!-- this format doesn't allow nesting. it is terminated by the next occurrence of the |
| 888 |
delimiter character |
| 889 |
--> |
| 890 |
<context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true"> |
| 891 |
<IncludeRules context="dq_string_rules" /> |
| 892 |
<StringDetect attribute="String" String="\%1" context="#stay" dynamic="true" /> |
| 893 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> |
| 894 |
</context> |
| 895 |
<!-- rules to be included in all dq_string contexts --> |
| 896 |
<context name="dq_string_rules" attribute="String" lineEndContext="#stay" > |
| 897 |
<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> |
| 898 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 899 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 900 |
</context> |
| 901 |
|
| 902 |
<!-- token array specific contexts --> |
| 903 |
|
| 904 |
<context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" > |
| 905 |
<IncludeRules context="token_array_rules" /> |
| 906 |
<Detect2Chars attribute="String" char="\" char1=")" context="#stay"/> |
| 907 |
<DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" /> |
| 908 |
<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" /> |
| 909 |
</context> |
| 910 |
<context name="gdl_token_array_1_nested" attribute="String" lineEndContext="#stay" > |
| 911 |
<IncludeRules context="token_array_rules" /> |
| 912 |
<DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" /> |
| 913 |
<DetectChar attribute="String" context="#pop" char=")" /> |
| 914 |
</context> |
| 915 |
|
| 916 |
<context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" > |
| 917 |
<IncludeRules context="token_array_rules" /> |
| 918 |
<Detect2Chars attribute="String" char="\" char1="}" context="#stay"/> |
| 919 |
<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" /> |
| 920 |
<DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" /> |
| 921 |
</context> |
| 922 |
<context name="gdl_token_array_2_nested" attribute="String" lineEndContext="#stay" > |
| 923 |
<IncludeRules context="token_array_rules" /> |
| 924 |
<DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" /> |
| 925 |
<DetectChar attribute="String" context="#pop" char="}" /> |
| 926 |
</context> |
| 927 |
|
| 928 |
<context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" > |
| 929 |
<IncludeRules context="token_array_rules" /> |
| 930 |
<Detect2Chars attribute="String" char="\" char1="]" context="#stay"/> |
| 931 |
<DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" /> |
| 932 |
<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" /> |
| 933 |
</context> |
| 934 |
<context name="gdl_token_array_3_nested" attribute="String" lineEndContext="#stay" > |
| 935 |
<IncludeRules context="token_array_rules" /> |
| 936 |
<DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" /> |
| 937 |
<DetectChar attribute="String" context="#pop" char="]" /> |
| 938 |
</context> |
| 939 |
|
| 940 |
<context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" > |
| 941 |
<IncludeRules context="token_array_rules" /> |
| 942 |
<Detect2Chars attribute="String" char="\" char1=">" context="#stay"/> |
| 943 |
<DetectChar attribute="String" context="gdl_token_array_4_nested" char="<" /> |
| 944 |
<DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" /> |
| 945 |
</context> |
| 946 |
<context name="gdl_token_array_4_nested" attribute="String" lineEndContext="#stay" > |
| 947 |
<IncludeRules context="token_array_rules" /> |
| 948 |
<DetectChar attribute="String" context="gdl_token_array_4_nested" char="<" /> |
| 949 |
<DetectChar attribute="String" context="#pop" char=">" /> |
| 950 |
</context> |
| 951 |
|
| 952 |
<!-- this format doesn't allow nesting. it is terminated by the next occurrence of the |
| 953 |
delimiter character |
| 954 |
--> |
| 955 |
<context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true"> |
| 956 |
<IncludeRules context="token_array_rules" /> |
| 957 |
<StringDetect attribute="String" String="\%1" context="#stay" dynamic="true"/> |
| 958 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> |
| 959 |
</context> |
| 960 |
|
| 961 |
<!-- rules to be included in all token_array contexts --> |
| 962 |
<context name="token_array_rules" attribute="String" lineEndContext="#stay" > |
| 963 |
<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> |
| 964 |
</context> |
| 965 |
|
| 966 |
<!-- apostrophed string specific contexts --> |
| 967 |
|
| 968 |
<context name="gdl_apostrophed_1" attribute="Raw String" lineEndContext="#stay" > |
| 969 |
<IncludeRules context="apostrophed_rules" /> |
| 970 |
<Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/> |
| 971 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" /> |
| 972 |
<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" /> |
| 973 |
</context> |
| 974 |
<context name="gdl_apostrophed_1_nested" attribute="Raw String" lineEndContext="#stay" > |
| 975 |
<IncludeRules context="apostrophed_rules" /> |
| 976 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" /> |
| 977 |
<DetectChar attribute="Raw String" context="#pop" char=")" /> |
| 978 |
</context> |
| 979 |
|
| 980 |
<context name="gdl_apostrophed_2" attribute="Raw String" lineEndContext="#stay" > |
| 981 |
<IncludeRules context="apostrophed_rules" /> |
| 982 |
<Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/> |
| 983 |
<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" /> |
| 984 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" /> |
| 985 |
</context> |
| 986 |
<context name="gdl_apostrophed_2_nested" attribute="Raw String" lineEndContext="#stay" > |
| 987 |
<IncludeRules context="apostrophed_rules" /> |
| 988 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" /> |
| 989 |
<DetectChar attribute="Raw String" context="#pop" char="}" /> |
| 990 |
</context> |
| 991 |
|
| 992 |
<context name="gdl_apostrophed_3" attribute="Raw String" lineEndContext="#stay" > |
| 993 |
<IncludeRules context="apostrophed_rules" /> |
| 994 |
<Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/> |
| 995 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" /> |
| 996 |
<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" /> |
| 997 |
</context> |
| 998 |
<context name="gdl_apostrophed_3_nested" attribute="Raw String" lineEndContext="#stay" > |
| 999 |
<IncludeRules context="apostrophed_rules" /> |
| 1000 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" /> |
| 1001 |
<DetectChar attribute="Raw String" context="#pop" char="]" /> |
| 1002 |
</context> |
| 1003 |
|
| 1004 |
<context name="gdl_apostrophed_4" attribute="Raw String" lineEndContext="#stay" > |
| 1005 |
<IncludeRules context="apostrophed_rules" /> |
| 1006 |
<Detect2Chars attribute="Raw String" char="\" char1=">" context="#stay"/> |
| 1007 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="<" /> |
| 1008 |
<DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" /> |
| 1009 |
</context> |
| 1010 |
<context name="gdl_apostrophed_4_nested" attribute="Raw String" lineEndContext="#stay" > |
| 1011 |
<IncludeRules context="apostrophed_rules" /> |
| 1012 |
<DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="<" /> |
| 1013 |
<DetectChar attribute="Raw String" context="#pop" char=">" /> |
| 1014 |
</context> |
| 1015 |
|
| 1016 |
<!-- this format doesn't allow nesting. it is terminated by the next occurrence of the |
| 1017 |
delimiter character |
| 1018 |
--> |
| 1019 |
<context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true"> |
| 1020 |
<IncludeRules context="apostrophed_rules" /> |
| 1021 |
<StringDetect attribute="Raw String" String="\%1" context="#stay" dynamic="true"/> |
| 1022 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> |
| 1023 |
</context> |
| 1024 |
|
| 1025 |
<!-- rules to be included in all apostrophed contexts --> |
| 1026 |
<context name="apostrophed_rules" attribute="Raw String" lineEndContext="#stay" > |
| 1027 |
<Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/> |
| 1028 |
</context> |
| 1029 |
|
| 1030 |
<!-- shell command specific contexts --> |
| 1031 |
|
| 1032 |
<context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" > |
| 1033 |
<IncludeRules context="shell_command_rules" /> |
| 1034 |
<Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/> |
| 1035 |
<DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" /> |
| 1036 |
<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" /> |
| 1037 |
</context> |
| 1038 |
<context name="gdl_shell_command_1_nested" attribute="Command" lineEndContext="#stay" > |
| 1039 |
<IncludeRules context="shell_command_rules" /> |
| 1040 |
<DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" /> |
| 1041 |
<DetectChar attribute="Command" context="#pop" char=")" /> |
| 1042 |
</context> |
| 1043 |
|
| 1044 |
<context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" > |
| 1045 |
<IncludeRules context="shell_command_rules" /> |
| 1046 |
<Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/> |
| 1047 |
<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" /> |
| 1048 |
<DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" /> |
| 1049 |
</context> |
| 1050 |
<context name="gdl_shell_command_2_nested" attribute="Command" lineEndContext="#stay" > |
| 1051 |
<IncludeRules context="shell_command_rules" /> |
| 1052 |
<DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" /> |
| 1053 |
<DetectChar attribute="Command" context="#pop" char="}" /> |
| 1054 |
</context> |
| 1055 |
|
| 1056 |
<context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" > |
| 1057 |
<IncludeRules context="shell_command_rules" /> |
| 1058 |
<Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/> |
| 1059 |
<DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" /> |
| 1060 |
<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" /> |
| 1061 |
</context> |
| 1062 |
<context name="gdl_shell_command_3_nested" attribute="Command" lineEndContext="#stay" > |
| 1063 |
<IncludeRules context="shell_command_rules" /> |
| 1064 |
<DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" /> |
| 1065 |
<DetectChar attribute="Command" context="#pop" char="]" /> |
| 1066 |
</context> |
| 1067 |
|
| 1068 |
<context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" > |
| 1069 |
<IncludeRules context="shell_command_rules" /> |
| 1070 |
<Detect2Chars attribute="Command" char="\" char1=">" context="#stay"/> |
| 1071 |
<DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="<" /> |
| 1072 |
<DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" /> |
| 1073 |
</context> |
| 1074 |
<context name="gdl_shell_command_4_nested" attribute="Command" lineEndContext="#stay" > |
| 1075 |
<IncludeRules context="shell_command_rules" /> |
| 1076 |
<DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="<" /> |
| 1077 |
<DetectChar attribute="Command" context="#pop" char=">" /> |
| 1078 |
</context> |
| 1079 |
|
| 1080 |
<!-- this format doesn't allow nesting. it is terminated by the next occurrence of the |
| 1081 |
delimiter character |
| 1082 |
--> |
| 1083 |
<context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true"> |
| 1084 |
<IncludeRules context="shell_command_rules" /> |
| 1085 |
<StringDetect attribute="Command" String="\%1" context="#stay" dynamic="true" /> |
| 1086 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> |
| 1087 |
</context> |
| 1088 |
|
| 1089 |
<!-- rules to be included in all shell_command contexts --> |
| 1090 |
<context name="shell_command_rules" attribute="Command" lineEndContext="#stay" > |
| 1091 |
<Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/> |
| 1092 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 1093 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 1094 |
</context> |
| 1095 |
|
| 1096 |
<!-- regular expression specific contexts --> |
| 1097 |
|
| 1098 |
<context name="gdl_regexpr_1" attribute="Regular Expression" lineEndContext="#stay" > |
| 1099 |
<IncludeRules context="regexpr_rules" /> |
| 1100 |
<Detect2Chars attribute="Regular Expression" char="\" char1=")" context="#stay"/> |
| 1101 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" /> |
| 1102 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" endRegion="GdlInput" /> |
| 1103 |
</context> |
| 1104 |
<context name="gdl_regexpr_1_nested" attribute="Regular Expression" lineEndContext="#stay" > |
| 1105 |
<IncludeRules context="regexpr_rules" /> |
| 1106 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" /> |
| 1107 |
<DetectChar attribute="Regular Expression" context="#pop" char=")" /> |
| 1108 |
</context> |
| 1109 |
|
| 1110 |
<context name="gdl_regexpr_2" attribute="Regular Expression" lineEndContext="#stay" > |
| 1111 |
<IncludeRules context="regexpr_rules" /> |
| 1112 |
<Detect2Chars attribute="Regular Expression" char="\" char1="}" context="#stay"/> |
| 1113 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" endRegion="GdlInput" /> |
| 1114 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" /> |
| 1115 |
</context> |
| 1116 |
<context name="gdl_regexpr_2_nested" attribute="Regular Expression" lineEndContext="#stay" > |
| 1117 |
<IncludeRules context="regexpr_rules" /> |
| 1118 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" /> |
| 1119 |
<DetectChar attribute="Regular Expression" context="#pop" char="}" /> |
| 1120 |
</context> |
| 1121 |
|
| 1122 |
<context name="gdl_regexpr_3" attribute="Regular Expression" lineEndContext="#stay" > |
| 1123 |
<IncludeRules context="regexpr_rules" /> |
| 1124 |
<Detect2Chars attribute="Regular Expression" char="\" char1="]" context="#stay"/> |
| 1125 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" /> |
| 1126 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" endRegion="GdlInput" /> |
| 1127 |
</context> |
| 1128 |
<context name="gdl_regexpr_3_nested" attribute="Regular Expression" lineEndContext="#stay" > |
| 1129 |
<IncludeRules context="regexpr_rules" /> |
| 1130 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" /> |
| 1131 |
<DetectChar attribute="Regular Expression" context="#pop" char="]" /> |
| 1132 |
</context> |
| 1133 |
|
| 1134 |
<context name="gdl_regexpr_4" attribute="Regular Expression" lineEndContext="#stay" > |
| 1135 |
<IncludeRules context="regexpr_rules" /> |
| 1136 |
<Detect2Chars attribute="Regular Expression" char="\" char1=">" context="#stay"/> |
| 1137 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="<" /> |
| 1138 |
<RegExpr attribute="GDL input" context="#pop#pop" String=">[uiomxn]*" endRegion="GdlInput" /> |
| 1139 |
</context> |
| 1140 |
<context name="gdl_regexpr_4_nested" attribute="Regular Expression" lineEndContext="#stay" > |
| 1141 |
<IncludeRules context="regexpr_rules" /> |
| 1142 |
<DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="<" /> |
| 1143 |
<DetectChar attribute="Regular Expression" context="#pop" char=">" /> |
| 1144 |
</context> |
| 1145 |
|
| 1146 |
<!-- this format doesn't allow nesting. it is terminated by the next occurrence of the |
| 1147 |
delimiter character |
| 1148 |
--> |
| 1149 |
<context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true"> |
| 1150 |
<IncludeRules context="regexpr_rules" /> |
| 1151 |
<StringDetect attribute="Regular Expression" String="\%1" context="#stay" dynamic="true" /> |
| 1152 |
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" /> |
| 1153 |
</context> |
| 1154 |
|
| 1155 |
<!-- rules to be included in all regexpr contexts --> |
| 1156 |
<context name="regexpr_rules" attribute="Regular Expression" lineEndContext="#stay" > |
| 1157 |
<Detect2Chars attribute="Regular Expression" char="\" char1="\" context="#stay"/> |
| 1158 |
<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> |
| 1159 |
<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> |
| 1160 |
</context> |
| 1161 |
|
| 1162 |
<!-- END of General delimited input support --> |
| 1163 |
|
| 1164 |
<!-- handle data in script --> |
| 1165 |
<context name="DATA" attribute="Data" lineEndContext="#stay"/> |
| 1166 |
<!-- END Ruby contexts --> |
| 1167 |
</contexts> |
| 1168 |
|
| 1169 |
<itemDatas> |
| 1170 |
<!-- BEGIN Ruby itemData --> |
| 1171 |
<itemData name="Ruby Normal Text" defStyleNum="dsNormal"/> |
| 1172 |
<itemData name="RUBY RAILS ERB Text" defStyleNum="dsExtension" bold="0" spellChecking="false"/> |
| 1173 |
<itemData name="Ruby Source" defStyleNum="dsDataType" bold="1" spellChecking="false"/> |
| 1174 |
|
| 1175 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1176 |
<itemData name="Attribute Definition" defStyleNum="dsOthers" spellChecking="false"/> |
| 1177 |
<itemData name="Access Control" defStyleNum="dsAttribute" bold="1" spellChecking="false"/> <!-- #0000FF --> |
| 1178 |
<itemData name="Definition" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1179 |
<itemData name="Pseudo variable" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1180 |
|
| 1181 |
<itemData name="Dec" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1182 |
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/> |
| 1183 |
<itemData name="Char" defStyleNum="dsChar" spellChecking="false"/> |
| 1184 |
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1185 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1186 |
<itemData name="Bin" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1187 |
|
| 1188 |
<itemData name="Symbol" defStyleNum="dsWarning" bold="0" underline="0" spellChecking="false"/> <!-- #D40000 --> |
| 1189 |
<itemData name="String" defStyleNum="dsString"/> |
| 1190 |
<itemData name="Raw String" defStyleNum="dsVerbatimString"/> <!-- #DD4A4A --> |
| 1191 |
<itemData name="Command" defStyleNum="dsInformation"/> <!-- #AA3000 --> |
| 1192 |
<itemData name="Message" defStyleNum="dsAttribute" spellChecking="false"/> <!-- #4000A7 --> |
| 1193 |
<itemData name="Regular Expression" defStyleNum="dsSpecialString" spellChecking="false"/> <!-- #4A5704 --> |
| 1194 |
<itemData name="Substitution" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 1195 |
<itemData name="Data" defStyleNum="dsNormal"/> |
| 1196 |
<!-- short for 'general delimited input' --> |
| 1197 |
<itemData name="GDL input" defStyleNum="dsOthers" /> |
| 1198 |
|
| 1199 |
<itemData name="Default globals" defStyleNum="dsVariable" bold="1" spellChecking="false"/> <!-- #C00000 --> |
| 1200 |
<itemData name="Global Variable" defStyleNum="dsVariable" spellChecking="false"/> <!-- #C00000 --> |
| 1201 |
<itemData name="Global Constant" defStyleNum="dsConstant" bold="1" spellChecking="false"/> <!-- #bb1188 --> |
| 1202 |
<itemData name="Constant" defStyleNum="dsDataType" spellChecking="false"/> |
| 1203 |
<itemData name="Constant Value" defStyleNum="dsConstant" bold="0" spellChecking="false"/> <!-- #bb1188 --> |
| 1204 |
<itemData name="Kernel methods" defStyleNum="dsFunction" bold="1" spellChecking="false"/> <!-- #000080, #CC0E86 --> |
| 1205 |
<itemData name="Member" defStyleNum="dsNormal" spellChecking="false"/> |
| 1206 |
<itemData name="Instance Variable" defStyleNum="dsOthers" spellChecking="false"/> |
| 1207 |
<itemData name="Class Variable" defStyleNum="dsOthers" spellChecking="false"/> |
| 1208 |
|
| 1209 |
<itemData name="Ruby Comment" defStyleNum="dsComment"/> |
| 1210 |
<itemData name="Blockcomment" defStyleNum="dsComment"/> |
| 1211 |
<itemData name="RDoc Value" defStyleNum="dsOthers"/> |
| 1212 |
|
| 1213 |
<!-- use these to mark errors and alerts things --> |
| 1214 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 1215 |
|
| 1216 |
<itemData name="Delimiter" defStyleNum="dsChar" spellChecking="false"/> |
| 1217 |
<itemData name="Operator" defStyleNum="dsChar" spellChecking="false"/> |
| 1218 |
<!-- END Ruby itemData --> |
| 1219 |
|
| 1220 |
<!-- BEGIN HTML itemData --> |
| 1221 |
<itemData name="Normal Text" defStyleNum="dsNormal" /> |
| 1222 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 1223 |
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" spellChecking="false"/> |
| 1224 |
<itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1225 |
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false"/> |
| 1226 |
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1227 |
<itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false"/> |
| 1228 |
<itemData name="Value" defStyleNum="dsString" spellChecking="false"/> |
| 1229 |
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1230 |
<itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1231 |
<!-- END HTML itemData --> |
| 1232 |
|
| 1233 |
</itemDatas> |
| 1234 |
</highlighting> |
| 1235 |
<general> |
| 1236 |
<comments> |
| 1237 |
<comment name="multiLine" start="<!--" end="-->" region="comment" /> |
| 1238 |
</comments> |
| 1239 |
<keywords casesensitive="1" weakDeliminator="!?"/> |
| 1240 |
</general> |
| 1241 |
</language> |
| 1242 |
<!-- kate: replace-tabs off; --> |