diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-11 16:14:23 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-11 16:14:23 -0600 |
commit | 7439a4b0e05832e047040ab8bf9ef13abd9288b2 (patch) | |
tree | 3a15e3033fa66b2d947daa14e6807b39f3dc84d1 /kate/data/r.xml | |
parent | 783973a7d6910fee50d90fcfaf439ae3bbb15b8c (diff) | |
download | tdelibs-7439a4b0e05832e047040ab8bf9ef13abd9288b2.tar.gz tdelibs-7439a4b0e05832e047040ab8bf9ef13abd9288b2.zip |
Update kate synatax highlighting files
This closes Bug 764
Diffstat (limited to 'kate/data/r.xml')
-rw-r--r-- | kate/data/r.xml | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kate/data/r.xml b/kate/data/r.xml index ada76ece5..bfb336f14 100644 --- a/kate/data/r.xml +++ b/kate/data/r.xml @@ -8,7 +8,7 @@ R : http://www.r-project.org/ RKWard : http://rkward.sourceforge.net/ --> -<language version="2.02" kateversion="2.5" name="R Script" section="Scripts" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPL"> +<language version="2.07" kateversion="2.5" name="R Script" section="Scripts" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPL"> <highlighting> <list name="controls"> @@ -77,6 +77,15 @@ <HlCStringChar attribute="String Char" context="#stay"/> </context> + <context attribute="Normal Text" lineEndContext="#stay" name="operator_rhs" fallthrough="true" fallthroughContext="#pop"> + <!-- While there is nothing of interest, stay in the context --> + <StringDetect attribute="Headline" context="Headline" String="##"/> + <DetectChar attribute="Comment" context="Comment" char="#"/> + <DetectChar attribute="String" context="#stay" char=" "/> + <!-- Operators other than +, -, and ! directly after another operator are an error. --> + <RegExpr attribute="Error" context="#stay" String="(\*|/|<|>|\!=|=|\||&|:|\^|@|\$|~)"/> + </context> + <context attribute="Headline" lineEndContext="#pop" name="Headline"/> <context attribute="Comment" lineEndContext="#pop" name="Comment"/> @@ -95,21 +104,12 @@ <StringDetect attribute="Headline" context="Headline" String="##"/> <DetectChar attribute="Comment" context="Comment" char="#"/> - <!-- The following three lines look worse than they are: If there are any other operators directly before or after -> and <-, this is a syntax error (expections: ->> and <<-) --> - <RegExpr attribute="Error" context="#stay" String="([\+\-\*/\^\:\$~!&\|=>@^])([<]{1,2}\-|\-[>]{1,2})"/> - <RegExpr attribute="Error" context="#stay" String="([<]{1,2}\-|\-[>]{1,2})([\+\-\*/\^\:\$~!&\|=<@])"/> - <RegExpr attribute="Error" context="#stay" String="([<]{3}|[>]{3})"/> - <RegExpr attribute="Assign" context="#stay" String="[<]{1,2}\-"/> - <RegExpr attribute="Assign" context="#stay" String="\-[>]{1,2}"/> - <!-- Much like above: Most other operators are forbidden around = --> - <RegExpr attribute="Error" context="#stay" String="([\+\-\*/\^\:\$~&\|@^])="/> - <RegExpr attribute="Error" context="#stay" String="=([\+\-\*/\^\:\$~!<>&\|@^])"/> - <RegExpr attribute="Assign" context="#stay" String="=(?!=)"/> - - <!-- These operators are fine as long as they're followed by something else or end of line. Error otherwise --> - <RegExpr attribute="Operator" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,3}|\^|@|\$|~)((?!(\+|\-|\*|/|<=|>=|=|\!=|\||&|:|\^|@|\$|~))|$)"/> - <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,3}|\^|@|\$|~){2,}"/> - <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/> + <!-- For (assignment) operators, enter a new context operator_rhs to check what follows (generally, that should not be another op) --> + <RegExpr attribute="Assign" context="operator_rhs" String="[<]{1,2}\-"/> + <RegExpr attribute="Assign" context="operator_rhs" String="\-[>]{1,2}"/> + <RegExpr attribute="Assign" context="operator_rhs" String="=(?!=)"/> + <RegExpr attribute="Operator" context="operator_rhs" String="(\+|\-|\*{1,2}|/|<=?|>=?|={1,2}|\!=?|\|{1,2}|&{1,2}|:{1,3}|\^|@|\$|~)"/> + <RegExpr attribute="Operator" context="operator_rhs" String="%[^%]*%"/> <DetectChar attribute="Symbol" context="ctx0" char="{" beginRegion="Brace1" /> @@ -143,6 +143,6 @@ <comments> <comment name="singleLine" start="#" end=""/> </comments> - <keywords casesensitive="1" /> + <keywords casesensitive="true" weakDeliminator="." additionalDeliminator="$"/> </general> </language> |