[rkward-cvs] SF.net SVN: rkward:[4121] trunk/rkward/rkward/syntax
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed Dec 14 11:47:38 UTC 2011
Revision: 4121
http://rkward.svn.sourceforge.net/rkward/?rev=4121&view=rev
Author: tfry
Date: 2011-12-14 11:47:38 +0000 (Wed, 14 Dec 2011)
Log Message:
-----------
! is another chainable unary operator besides + and -
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 2011-12-13 22:55:06 UTC (rev 4120)
+++ trunk/rkward/rkward/syntax/r-syntax-test.R 2011-12-14 11:47:38 UTC (rev 4121)
@@ -34,10 +34,13 @@
x += 1 -= x1 *= x2 # syntax error
x =* 1 =/ x1 // x2 # syntax error
x =+ 1 =- x1 # These look misleading, but are legal
+ 1 +-!-++--!!+ 1 # Crazy, but legal
+ x +!= y +-= z +!/ 2 # These are illegal, again
"%my 1st infix%" <- function (x, y) { x + y } # legal infix
3 %my 1st infix% 4
- "%my%infix%" <- function (x, y) { x + y } # illegal infix
- 3 %my%infix% 4 # syntax error
+ "%my%infix%" <- function (x, y) { x + y } # illegal infix
+ 3 %my%infix% 4 # syntax error
+ 3 %my%infix%other% 4 # but could be continued to something syntactically legal
) # unexpected closing ')'
(}) # unexpected closing '}'
},
Modified: trunk/rkward/rkward/syntax/r.xml
===================================================================
--- trunk/rkward/rkward/syntax/r.xml 2011-12-13 22:55:06 UTC (rev 4120)
+++ trunk/rkward/rkward/syntax/r.xml 2011-12-14 11:47:38 UTC (rev 4121)
@@ -8,7 +8,7 @@
R : http://www.r-project.org/
RKWard : http://rkward.sourceforge.net/
-->
-<language version="2.06" 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">
@@ -82,8 +82,8 @@
<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="(\*|/|<|>|=|\!|\||&|:|\^|@|\$|~)"/>
+ <!-- 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"/>
@@ -108,7 +108,7 @@
<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="(\+|\-|\*{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" />
Modified: trunk/rkward/rkward/syntax/rkward.xml
===================================================================
--- trunk/rkward/rkward/syntax/rkward.xml 2011-12-13 22:55:06 UTC (rev 4120)
+++ trunk/rkward/rkward/syntax/rkward.xml 2011-12-14 11:47:38 UTC (rev 4121)
@@ -9,7 +9,7 @@
R : http://www.r-project.org/
RKWard : http://rkward.sourceforge.net/
-->
-<language version="2.06" kateversion="2.5" name="R interactive session" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
+<language version="2.07" kateversion="2.5" name="R interactive session" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
<highlighting>
<list name="controls">
<item> for </item>
@@ -112,8 +112,8 @@
<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="(\*|/|<|>|=|\!|\||&|:|\^|@|\$|~)"/>
+ <!-- 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 -->
@@ -135,7 +135,7 @@
<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="(\+|\-|\*{1,2}|/|<=?|>=?|={1,2}|\!=?|\|{1,2}|&{1,2}|:{1,3}|\^|@|\$|~)"/>
<RegExpr attribute="Operator" context="operator_rhs" String="%[^%]*%"/>
<!-- Contrary to the normal R Script highlighting, we don't start a region here, but we do go into a command sub-context -->
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