[rkward-cvs] SF.net SVN: rkward: [1000] trunk/rkward/rkward/syntax

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Dec 8 11:51:33 UTC 2006


Revision: 1000
          http://svn.sourceforge.net/rkward/?rev=1000&view=rev
Author:   tfry
Date:     2006-12-08 03:51:32 -0800 (Fri, 08 Dec 2006)

Log Message:
-----------
Single quoted and duoble quoted strings need different contexts.
Else a non-escaped single quote could end a double quoted string, and vice versa.

Modified Paths:
--------------
    trunk/rkward/rkward/syntax/r-syntax-test.R
    trunk/rkward/rkward/syntax/r.xml
    trunk/rkward/rkward/syntax/rkward.xml

Modified: trunk/rkward/rkward/syntax/r-syntax-test.R
===================================================================
--- trunk/rkward/rkward/syntax/r-syntax-test.R	2006-12-07 14:57:22 UTC (rev 999)
+++ trunk/rkward/rkward/syntax/r-syntax-test.R	2006-12-08 11:51:32 UTC (rev 1000)
@@ -47,7 +47,7 @@
 print ("hi", quote=(x==1))
 
 # quotes:
-cat ("normal quote", 'single quoted', "with escapes \"\'", 'with escapes 2 \'\"')
+cat ("normal quote", 'single quoted', "with escapes \" ' ", 'with escapes 2 \' " ')
 `backquoted symbol name` <- 1
 "backquoted symbol name"	# This will print the string
 `backquoted symbol name`	# This will print the value (1)

Modified: trunk/rkward/rkward/syntax/r.xml
===================================================================
--- trunk/rkward/rkward/syntax/r.xml	2006-12-07 14:57:22 UTC (rev 999)
+++ trunk/rkward/rkward/syntax/r.xml	2006-12-08 11:51:32 UTC (rev 1000)
@@ -60,6 +60,10 @@
 
 		<context attribute="String" lineEndContext="#stay" name="string">
 			<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>
@@ -75,7 +79,7 @@
 		<!-- This context is not really used, but contains the common rules -->
 		<context name="CommonRules" lineEndContext="#stay" attribute="Normal Text" >
 			<DetectChar attribute="String" context="string" char="""/>
-			<DetectChar attribute="String" context="string" char="'"/>
+			<DetectChar attribute="String" context="string2" char="'"/>
 			<DetectChar attribute="String" context="backquotedsymbol" char="`"/>
 			<keyword attribute="Control Structure" context="#stay" String="controls"/>
 			<keyword attribute="Reserved Words" context="#stay" String="words"/>

Modified: trunk/rkward/rkward/syntax/rkward.xml
===================================================================
--- trunk/rkward/rkward/syntax/rkward.xml	2006-12-07 14:57:22 UTC (rev 999)
+++ trunk/rkward/rkward/syntax/rkward.xml	2006-12-08 11:51:32 UTC (rev 1000)
@@ -73,11 +73,17 @@
 		<context attribute="String" lineEndContext="#stay" name="string">
 			<IncludeRules context="CommandContinuationCheck"/>
 			<DetectChar attribute="String" context="#pop" char="""/>
+			<HlCStringChar attribute="String Char" context="#stay"/>
+		</context>
+
+		<context attribute="String" lineEndContext="#stay" name="string2">
+			<IncludeRules context="CommandContinuationCheck"/>
 			<DetectChar attribute="String" context="#pop" char="'"/>
 			<HlCStringChar attribute="String Char" context="#stay"/>
 		</context>
 
 		<context attribute="Identifier" lineEndContext="#stay" name="backquotedsymbol">
+			<IncludeRules context="CommandContinuationCheck"/>
 			<DetectChar attribute="String" context="#pop" char="`"/>
 			<HlCStringChar attribute="String Char" context="#stay"/>
 		</context>
@@ -97,7 +103,7 @@
 		<!-- This context is not really used, but contains the common rules -->
 		<context attribute="Normal Text" name="CommonRules" lineEndContext="#stay">
 			<DetectChar attribute="String" context="string" char="""/>
-			<DetectChar attribute="String" context="string" char="'"/>
+			<DetectChar attribute="String" context="string2" char="'"/>
 			<DetectChar attribute="String" context="backquotedsymbol" char="`"/>
 			<keyword attribute="Control Structure" context="#stay" String="controls"/>
 			<keyword attribute="Reserved Words" context="#stay" String="words"/>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list