diff options
Diffstat (limited to 'kate/data/ruby.xml')
-rw-r--r-- | kate/data/ruby.xml | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/kate/data/ruby.xml b/kate/data/ruby.xml index 76b88f719..c59f01529 100644 --- a/kate/data/ruby.xml +++ b/kate/data/ruby.xml @@ -6,7 +6,7 @@ Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi) Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at) - Copyright (C) 2008 by Robin Pedersen (robin.pedersen@runbox.com) + Copyright (C) 2008 by Robin Pedersen (robinpeder@gmail.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -30,7 +30,12 @@ --> <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> -<language name="Ruby" version="1.17" kateversion="2.4" section="Scripts" extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb" mimetype="application/x-ruby" author="Stefan Lang (langstefan@gmx.at), Sebastian Vuorinen (sebastian.vuorinen@helsinki.fi), Robin Pedersen (robin.pedersen@runbox.com)" license="LGPL"> +<language name="Ruby" section="Scripts" + version="1.18" kateversion="2.4" + extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb" + mimetype="application/x-ruby" + style="ruby" indenter="ruby" + author="Stefan Lang (langstefan@gmx.at), Sebastian Vuorinen (sebastian.vuorinen@helsinki.fi), Robin Pedersen (robinpeder@gmail.com)" license="LGPL"> <highlighting> @@ -194,7 +199,7 @@ <!-- "def" - "end" blocks --> <!-- check for statement modifiers with regexes --> - <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/> + <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/> <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/> <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/> <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> @@ -209,7 +214,7 @@ <RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/> <RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/> <!-- elsif/else close the current block and start a new one --> - <RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\b|$)" context="#stay" endRegion="def block" beginRegion="def block"/> + <RegExpr attribute="Keyword" String="\b(else|elsif|rescue|ensure)\b" context="#stay" endRegion="def block" beginRegion="def block"/> <StringDetect attribute="Operator" String="..." context="#stay"/> <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/> @@ -248,7 +253,7 @@ <HlCChar attribute="Char" context="check_div_1"/> <!-- Check for =begin before assignment operator. --> - <StringDetect attribute="Blockcomment" String="=begin" context="Embedded documentation" beginRegion="comment block" column="0"/> + <RegExpr attribute="Blockcomment" String="^=begin(?:\s|$)" context="Embedded documentation" beginRegion="comment block" column="0"/> <!-- recognize the beginning of a HEREDOC This uses new features in Kate 2.3 and later @@ -271,7 +276,8 @@ <StringDetect attribute="Operator" String="%=" context="#stay" insensitive="0"/> <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/> - <RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="check_div_1"/> + <RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?" context="check_div_1"/> + <RegExpr attribute="Symbol" String=":\[\]=?" contex="check_div_1"/> <DetectChar attribute="String" char=""" context="Quoted String"/> <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/> @@ -309,34 +315,36 @@ <!-- A slash is always a division operator, even if preceeded by whitespace --> <context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop"> <RegExpr attribute="Normal Text" String="\s*" context="#stay"/> - <DetectChar attribute="Operator" char="/" context="#pop"/> + <AnyChar attribute="Operator" String="/%" context="#pop"/> </context> <!-- Same as check_div_1, but with double pop to exit the surrounding context --> <context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> <RegExpr attribute="Normal Text" String="\s*" context="#stay"/> - <DetectChar attribute="Operator" char="/" context="#pop#pop"/> + <AnyChar attribute="Operator" String="/%" context="#pop#pop"/> </context> <!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace --> <context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop"> - <DetectChar attribute="Operator" char="/" context="#pop"/> + <AnyChar attribute="Operator" String="/%" context="#pop"/> <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_internal"/> </context> <!-- Internal context used by check_div_2 --> <context name="check_div_2_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> - <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop"/> +<!-- <DetectChar attribute="Operator" char="%" context="#pop#pop"/> --> + <RegExpr attribute="Operator" String="[/%](?=\s)" context="#pop#pop"/> </context> <!-- Same as check_div_2, but with double pop to exit the surrounding context --> <context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> - <DetectChar attribute="Operator" char="/" context="#pop#pop"/> + <AnyChar attribute="Operator" String="/%" context="#pop#pop"/> <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_pop_internal"/> </context> <!-- Internal context used by check_div_2_pop --> <context name="check_div_2_pop_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop#pop" lineEndContext="#pop#pop#pop"> + <DetectChar attribute="Operator" char="%" context="#pop#pop#pop"/> <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop#pop"/> </context> @@ -346,22 +354,20 @@ <IncludeRules context="Normal"/> </context> - <context name="Find closing block brace" attribute="Normal Text" lineEndContext="#stay"> - <DetectChar attribute="Operator" char="}" context="check_div_1_pop" endRegion="def block"/> - <IncludeRules context="Normal"/> - </context> + <context name="Find closing block brace" attribute="Normal Text" lineEndContext="#stay"> + <DetectChar attribute="Operator" char="}" context="check_div_1_pop" endRegion="def block"/> + <IncludeRules context="Normal"/> + </context> <context name="Quoted String" attribute="String" lineEndContext="#stay"> <StringDetect attribute="String" String="\\" context="#stay"/> <RegExpr attribute="String" String="\\\"" context="#stay"/> <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> - <!--HlCChar attribute="Char" context="#pop"/--> <DetectChar char=""" attribute="String" context="check_div_1_pop"/> </context> <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay"> - <!-- <HlCChar attribute="Char" context="#pop"/> --> <StringDetect attribute="String" String="\\" context="#stay"/> <RegExpr attribute="String" String="\\\'" context="#stay"/> <DetectChar char="'" attribute="Raw String" context="check_div_1_pop"/> @@ -372,12 +378,11 @@ <RegExpr attribute="String" String="\\\`" context="#stay"/> <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> - <HlCChar attribute="Char" context="check_div_1_pop"/> <DetectChar char="`" attribute="Command" context="check_div_1_pop"/> </context> - <context name="Embedded documentation" attribute="Comment" lineEndContext="#stay"> - <StringDetect attribute="Comment" String="=end" context="#pop" endRegion="comment block" column="0"/> + <context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay"> + <RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/> </context> <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay"> @@ -442,22 +447,22 @@ <RegExpr attribute="Keyword" context="indented_heredoc" String=""?(\w+)"?" /> </context> <!-- these are the real heredoc contexts --> - <context name="indented_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> + <context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>--> <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/> <IncludeRules context="heredoc_rules" /> </context> - <context name="apostrophed_indented_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> + <context name="apostrophed_indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>--> <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/> </context> - <context name="normal_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> + <context name="normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>--> <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/> <IncludeRules context="heredoc_rules" /> </context> - <context name="apostrophed_normal_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> + <context name="apostrophed_normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>--> <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/> </context> @@ -890,13 +895,15 @@ <itemData name="Region Marker" defStyleNum="dsNormal" color="#0000ff"/> <itemData name="RDoc Value" defStyleNum="dsOthers"/> + <itemData name="Here Document" defStyleNum="dsOthers"/> + <!-- use these to mark errors and alerts things --> <itemData name="Error" defStyleNum="dsError" /> <itemData name="Alert" defStyleNum="dsAlert" /> - - <itemData name="Delimiter" defStyleNum="dsChar"/> + + <itemData name="Delimiter" defStyleNum="dsNormal" color="#FF9FEC"/> <itemData name="Expression" defStyleNum="dsOthers"/> - <itemData name="Operator" defStyleNum="dsChar"/> + <itemData name="Operator" defStyleNum="dsNormal" color="#FF9FEC"/> </itemDatas> </highlighting> <general> |