[rkward] rkward/syntax: Sync with r.xml in syntax-highlighting

Thomas Friedrichsmeier null at kde.org
Mon Apr 23 09:03:43 UTC 2018


Git commit 6424a0c12ee56225f24e436606b7cc87bd182c64 by Thomas Friedrichsmeier.
Committed on 23/04/2018 at 08:58.
Pushed by tfry into branch 'master'.

Sync with r.xml in syntax-highlighting

M  +37   -33   rkward/syntax/r.xml
M  +44   -39   rkward/syntax/rkward.xml

https://commits.kde.org/rkward/6424a0c12ee56225f24e436606b7cc87bd182c64

diff --git a/rkward/syntax/r.xml b/rkward/syntax/r.xml
index ea6b9dd0..bfe72838 100644
--- a/rkward/syntax/r.xml
+++ b/rkward/syntax/r.xml
@@ -6,34 +6,34 @@
 	license: GPL v2
 	Kate   : http://kate.kde.org/
 	R      : http://www.r-project.org/
-	RKWard : http://rkward.kde.org/
+	RKWard : http://rkward.sourceforge.net/
 	-->
-<language version="2.07" kateversion="2.5" name="R Script" section="Scripts" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPL">
+<language version="7" kateversion="5.0" name="R Script" section="Scientific" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPLv2">
 <highlighting>
 
 	<list name="controls">
-		<item> for </item>
-		<item> in </item>
-		<item> next </item>
-		<item> break </item>
-		<item> while </item>
-		<item> repeat </item>
-		<item> if </item>
-		<item> else </item>
-		<item> switch </item>
-		<item> function </item>
+		<item>for</item>
+		<item>in</item>
+		<item>next</item>
+		<item>break</item>
+		<item>while</item>
+		<item>repeat</item>
+		<item>if</item>
+		<item>else</item>
+		<item>switch</item>
+		<item>function</item>
 	</list>
 	<list name="words">
-		<item> TRUE </item>
-		<item> FALSE </item>
-		<item> NULL </item>
-		<item> NA </item>
-		<item> NA_integer_ </item>
-		<item> NA_real_ </item>
-		<item> NA_complex_ </item>
-		<item> NA_character_ </item>
-		<item> Inf </item>
-		<item> NaN </item>
+		<item>TRUE</item>
+		<item>FALSE</item>
+		<item>NULL</item>
+		<item>NA</item>
+		<item>NA_integer_</item>
+		<item>NA_real_</item>
+		<item>NA_complex_</item>
+		<item>NA_character_</item>
+		<item>Inf</item>
+		<item>NaN</item>
 	</list>
 
 	<contexts>
@@ -44,7 +44,7 @@
 			<DetectChar attribute="Error" context="#stay" char="}" />
 			<DetectChar attribute="Error" context="#stay" char=")"/>
 		</context>
-		
+
 		<context attribute="Normal Text" lineEndContext="#stay" name="ctx0">
 			<IncludeRules context="CommonRules"/>
 
@@ -52,8 +52,8 @@
 			<DetectChar attribute="Error" context="#stay" char=")"/>
 		</context>
 
-		<context attribute="In Parenthesis" lineEndContext="#stay" name="parenthesis">
-			<LineContinue attribute="Boolean" context="#stay"/>
+		<context attribute="Normal Text" lineEndContext="#stay" name="parenthesis">
+			<LineContinue attribute="Operator" context="#stay"/>
 			<DetectChar attribute="Symbol" context="#pop" char=")"/>
 
 			<RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
@@ -66,12 +66,12 @@
 			<DetectChar attribute="String" context="#pop" char="""/>
 			<HlCStringChar attribute="String Char" context="#stay"/>
 		</context>
-		
+
 		<context attribute="String" lineEndContext="#stay" name="string2">
 			<DetectChar attribute="String" context="#pop" char="'"/>
 			<HlCStringChar attribute="String Char" context="#stay"/>
 		</context>
-		
+
 		<context attribute="Identifier" lineEndContext="#stay" name="backquotedsymbol">
 			<DetectChar attribute="String" context="#pop" char="`"/>
 			<HlCStringChar attribute="String Char" context="#stay"/>
@@ -86,8 +86,12 @@
 			<RegExpr attribute="Error" context="#stay" String="(\*|/|<|>|\!=|=|\||&|:|\^|@|\$|~)"/>
 		</context>
 
-		<context attribute="Headline" lineEndContext="#pop" name="Headline"/>
-		<context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+		<context attribute="Headline" lineEndContext="#pop" name="Headline">
+			<IncludeRules context="##Alerts" />
+		</context>
+		<context attribute="Comment" lineEndContext="#pop" name="Comment">
+			<IncludeRules context="##Alerts" />
+		</context>
 
 		<!-- This context is not really used, but contains the common rules -->
 		<context name="CommonRules" lineEndContext="#stay" attribute="Normal Text" >
@@ -110,7 +114,7 @@
 			<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" />
 
 			<!-- This is needed only to assist variable based indentation -->
@@ -120,7 +124,7 @@
 	</contexts>
 
 	<itemDatas>
-	<!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
+		<!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
 		<itemData name="Normal Text" defStyleNum="dsNormal"/>
 		<itemData name="Symbol" defStyleNum="dsNormal"/>
 		<itemData name="Keyword" defStyleNum="dsKeyword"/>
@@ -129,10 +133,10 @@
 		<itemData name="Headline" defStyleNum="dsNormal" color="#b00000" selColor="#b00000" bold="1" italic="0"/> <!-- KDE default color: text 5 -->
 		<itemData name="Comment" defStyleNum="dsComment"/>
 		<itemData name="Assign" defStyleNum="dsNormal" color="#336366" selColor="#ccc099" bold="1" italic="0"/> <!-- KDE default color: text 7 -->
-		<itemData name="Control Structure" defStyleNum="dsNormal" color="#0000bf" selColor="#bfbf00"/> <!-- KDE default color: text 2 -->
+		<itemData name="Control Structure" defStyleNum="dsControlFlow"/>
 		<itemData name="Reserved Words" defStyleNum="dsOthers"/>
 		<itemData name="Error" defStyleNum="dsError"/>
-		<itemData name="Operator" defStyleNum="dsNormal"  color="#803f00" selColor="#000077" bold="0" italic="0"/> <!-- KDE default color: focussed text -->
+		<itemData name="Operator" defStyleNum="dsOperator"/>
 		<itemData name="String Char"  defStyleNum="dsChar"/>
 		<itemData name="Float" defStyleNum="dsFloat"/>
 		<itemData name="Int" defStyleNum="dsDecVal"/>
diff --git a/rkward/syntax/rkward.xml b/rkward/syntax/rkward.xml
index 6b70734c..4d20df8e 100644
--- a/rkward/syntax/rkward.xml
+++ b/rkward/syntax/rkward.xml
@@ -9,33 +9,34 @@
 	R      : http://www.r-project.org/
 	RKWard : http://rkward.kde.org/
 	-->
-<language version="2.07" kateversion="2.5" name="R interactive session" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
+<language version="7" kateversion="2.5" name="R interactive session" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
 <highlighting>
+
 	<list name="controls">
-	<item> for </item>
-	<item> in </item>
-	<item> next </item>
-	<item> break </item>
-	<item> while </item>
-	<item> repeat </item>
-	<item> if </item>
-	<item> else </item>
-	<item> switch </item>
-	<item> function </item>
+		<item>for</item>
+		<item>in</item>
+		<item>next</item>
+		<item>break</item>
+		<item>while</item>
+		<item>repeat</item>
+		<item>if</item>
+		<item>else</item>
+		<item>switch</item>
+		<item>function</item>
 	</list>
 	<list name="words">
-	<item> TRUE </item>
-	<item> FALSE </item>
-	<item> NULL </item>
-	<item> NA </item>
-	<item> NA_integer_ </item>
-	<item> NA_real_ </item>
-	<item> NA_complex_ </item>
-	<item> NA_character_ </item>
-	<item> Inf </item>
-	<item> NaN </item>
+		<item>TRUE</item>
+		<item>FALSE</item>
+		<item>NULL</item>
+		<item>NA</item>
+		<item>NA_integer_</item>
+		<item>NA_real_</item>
+		<item>NA_complex_</item>
+		<item>NA_character_</item>
+		<item>Inf</item>
+		<item>NaN</item>
 	</list>
-	
+
 	<contexts>
 		<!-- This context dispatches to the two main contexts output or command. -->
 		<context attribute="Prompt" lineEndContext="#stay" name="ctxbase">
@@ -93,8 +94,22 @@
 			<HlCStringChar attribute="String Char" context="#stay"/>
 		</context>
 
-		<context attribute="Headline" lineEndContext="#pop" name="Headline"/>
-		<context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+		<context attribute="Normal Text" lineEndContext="#stay" name="operator_rhs" fallthrough="true" fallthroughContext="#pop">
+			<IncludeRules context="CommandContinuationCheck"/>
+			<!-- 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">
+			<IncludeRules context="##Alerts" />
+		</context>
+		<context attribute="Comment" lineEndContext="#pop" name="Comment">
+			<IncludeRules context="##Alerts" />
+		</context>
 
 		<!-- This context is not really used, but meant to be included. It checks whether a new line is a continuation of a command. If so, it eats the "+ " at the line start. Else it tries to pop back to the top level -->
 		<context attribute="Normal Text" name="CommandContinuationCheck" lineEndContext="#stay">
@@ -106,18 +121,8 @@
 			<Detect2Chars attribute="Prompt" context="#stay" char="+" char1=" " column="0"/>
 		</context>
 
-		<context attribute="Normal Text" lineEndContext="#stay" name="operator_rhs" fallthrough="true" fallthroughContext="#pop">
-			<IncludeRules context="CommandContinuationCheck"/>
-			<!-- 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>
-
 		<!-- This context is not really used, but contains the common rules -->
-		<context attribute="Normal Text" name="CommonRules" lineEndContext="#stay">
+		<context name="CommonRules" lineEndContext="#stay" attribute="Normal Text" >
 			<DetectChar attribute="String" context="string" char="""/>
 			<DetectChar attribute="String" context="string2" char="'"/>
 			<DetectChar attribute="String" context="backquotedsymbol" char="`"/>
@@ -148,21 +153,21 @@
 	</contexts>
 
 	<itemDatas>
-		<itemData name="Output" defStyleNum="dsOthers"/>
 		<!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
+		<itemData name="Output" defStyleNum="dsOthers"/>
+		<itemData name="Prompt" defStyleNum="dsNormal"/>
 		<itemData name="Normal Text" defStyleNum="dsNormal"/>
 		<itemData name="Symbol" defStyleNum="dsNormal"/>
-		<itemData name="Prompt" defStyleNum="dsNormal"/>
 		<itemData name="Keyword" defStyleNum="dsKeyword"/>
 		<itemData name="Identifier" defStyleNum="dsDataType"/>
 		<itemData name="String" defStyleNum="dsString"/>
 		<itemData name="Headline" defStyleNum="dsNormal" color="#b00000" selColor="#b00000" bold="1" italic="0"/> <!-- KDE default color: text 5 -->
 		<itemData name="Comment" defStyleNum="dsComment"/>
 		<itemData name="Assign" defStyleNum="dsNormal" color="#336366" selColor="#ccc099" bold="1" italic="0"/> <!-- KDE default color: text 7 -->
-		<itemData name="Control Structure" defStyleNum="dsNormal" color="#0000bf" selColor="#bfbf00"/> <!-- KDE default color: text 2 -->
+		<itemData name="Control Structure" defStyleNum="dsControlFlow"/>
 		<itemData name="Reserved Words" defStyleNum="dsOthers"/>
 		<itemData name="Error" defStyleNum="dsError"/>
-		<itemData name="Operator" defStyleNum="dsNormal"  color="#803f00" selColor="#000077" bold="0" italic="0"/> <!-- KDE default color: focussed text -->
+		<itemData name="Operator" defStyleNum="dsOperator"/>
 		<itemData name="String Char"  defStyleNum="dsChar"/>
 		<itemData name="Float" defStyleNum="dsFloat"/>
 		<itemData name="Int" defStyleNum="dsDecVal"/>



More information about the rkward-tracker mailing list