[rkward-cvs] SF.net SVN: rkward: [773] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu Sep 28 08:09:53 UTC 2006
Revision: 773
http://svn.sourceforge.net/rkward/?rev=773&view=rev
Author: tfry
Date: 2006-09-28 01:09:39 -0700 (Thu, 28 Sep 2006)
Log Message:
-----------
Move syntax highlighting definition files to syntax subdirectory
Modified Paths:
--------------
trunk/rkward/configure
trunk/rkward/configure.in
trunk/rkward/rkward/Makefile.am
Added Paths:
-----------
trunk/rkward/rkward/syntax/
trunk/rkward/rkward/syntax/Makefile.am
trunk/rkward/rkward/syntax/r-syntax-test.R
trunk/rkward/rkward/syntax/r.xml
trunk/rkward/rkward/syntax/rkward.xml
Removed Paths:
-------------
trunk/rkward/rkward/r-syntax-test.R
trunk/rkward/rkward/r.xml
trunk/rkward/rkward/rkward.xml
Modified: trunk/rkward/configure
===================================================================
--- trunk/rkward/configure 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/configure 2006-09-28 08:09:39 UTC (rev 773)
@@ -35774,6 +35774,8 @@
ac_config_files="$ac_config_files rkward/settings/Makefile"
+ac_config_files="$ac_config_files rkward/syntax/Makefile"
+
ac_config_files="$ac_config_files rkward/windows/Makefile"
cat >confcache <<\_ACEOF
@@ -36386,6 +36388,7 @@
"rkward/rbackend/rpackages/Makefile") CONFIG_FILES="$CONFIG_FILES rkward/rbackend/rpackages/Makefile" ;;
"rkward/scriptbackends/Makefile") CONFIG_FILES="$CONFIG_FILES rkward/scriptbackends/Makefile" ;;
"rkward/settings/Makefile") CONFIG_FILES="$CONFIG_FILES rkward/settings/Makefile" ;;
+ "rkward/syntax/Makefile") CONFIG_FILES="$CONFIG_FILES rkward/syntax/Makefile" ;;
"rkward/windows/Makefile") CONFIG_FILES="$CONFIG_FILES rkward/windows/Makefile" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
Modified: trunk/rkward/configure.in
===================================================================
--- trunk/rkward/configure.in 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/configure.in 2006-09-28 08:09:39 UTC (rev 773)
@@ -95,6 +95,7 @@
AC_CONFIG_FILES([ rkward/rbackend/rpackages/Makefile ])
AC_CONFIG_FILES([ rkward/scriptbackends/Makefile ])
AC_CONFIG_FILES([ rkward/settings/Makefile ])
+AC_CONFIG_FILES([ rkward/syntax/Makefile ])
AC_CONFIG_FILES([ rkward/windows/Makefile ])
AC_OUTPUT
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
Modified: trunk/rkward/rkward/Makefile.am
===================================================================
--- trunk/rkward/rkward/Makefile.am 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/rkward/Makefile.am 2006-09-28 08:09:39 UTC (rev 773)
@@ -38,7 +38,7 @@
$(LIBSOCKET) -L$(R_HOMEDIR)/lib -lR $(R_LAPACK_FLAG) $(R_BLAS_FLAG) -lkatepartinterfaces
SUBDIRS = plugins dataeditor settings plugin agents rbackend dialogs scriptbackends \
- misc core icons windows
+ misc core icons windows syntax
install-data-local:
$(mkinstalldirs) $(kde_appsdir)/Applications/
@@ -82,6 +82,3 @@
fi
phpfilesdir = $(kde_datadir)/rkward/phpfiles
-
-katesyntaxdir = $(kde_datadir)/katepart/syntax/
-katesyntax_DATA = r.xml rkward.xml
Deleted: trunk/rkward/rkward/r-syntax-test.R
===================================================================
--- trunk/rkward/rkward/r-syntax-test.R 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/rkward/r-syntax-test.R 2006-09-28 08:09:39 UTC (rev 773)
@@ -1,49 +0,0 @@
-## This is a Headline
-# This is a Comment
-
-myBoolean <- TRUE
-myNa <- NA
-
-myString <- "This is a String"
-"String 2" -> myString2
-myString3 <<- "global assignment"
-myString4 <- as.character( 3 + 4 )
-
-myMatrix <- matrix( 1:6, nrow = 3, ncol = 2 )
-myMatrix2 <- myMatrix + 4
-myMatrix3 <- t( myMatrix ) %*% myMatrix
-myMatrix[ myMatrix < 4 ] <- 0
-myMatrix[ myMatrix == 4 ] <- 10
-myFloat = 1.234
-myBooleanVector <- c( 1, 5 ) %in% c( 1, 2, 3, 4 )
-
-if( 3 > 4 ) {
- stop( "Error: 3 is not graeter than 4!!!" )
-} else if( 3 == 4 ) {
- stop( "Error: 3 is not equal to 4!!!" )
-}
-
-for( i in 2:5 ) {
- print( paste( "No. ", as.character( i + ( 3 + i ) ), sep = "" ) )
-}
-
-try ( {
- x <<- 1
- x <<<- 1 # syntax error
- x += 1 -= x1 *= x2 # syntax error
- x =+ 1 =- x1 =* x2 # syntax error
- "%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
- ) # unexpected closing ')'
- (}) # unexpected closing '}'
-},
-silent=FALSE)
-
-myList <- list( a = 1, a2 = 2, a2_b = 3 )
-
-x <- 1
-print ("hi", quote=(x==1))
-
-cat( "\nNo Errors!\n" )
Deleted: trunk/rkward/rkward/r.xml
===================================================================
--- trunk/rkward/rkward/r.xml 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/rkward/r.xml 2006-09-28 08:09:39 UTC (rev 773)
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!-- Kate 2.5 (KDE 3.5) highlighting module for R
- based on an earlier version by E.L. Willighagen. Code folding code by Ben Goodrich
- version 2.0: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
- license: GPL v2
- Kate : http://kate.kde.org/
- R : http://www.r-project.org/
- RKWard : http://rkward.sourceforge.net/
- -->
-<language version="2.0" kateversion="2.5" name="R Script" section="Scripts"
-extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" 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>
- </list>
- <list name="words">
- <item> TRUE </item>
- <item> FALSE </item>
- <item> NULL </item>
- <item> NA </item>
- <item> Inf </item>
- <item> NaN </item>
- </list>
-
- <contexts>
- <!-- This context is really only good for detecting unexpected closing braces '}'. Since opening braces go to ctx0 (and nesting in there), this context is only active on the base level -->
- <context attribute="Normal Text" lineEndContext="#stay" name="level0">
- <IncludeRules context="CommonRules"/>
-
- <DetectChar attribute="Error" context="#stay" char="}" />
- <DetectChar attribute="Error" context="#stay" char=")"/>
- </context>
-
- <context attribute="Normal Text" lineEndContext="#stay" name="ctx0">
- <IncludeRules context="CommonRules"/>
-
- <DetectChar attribute="Symbol" context="#pop" char="}" endRegion="Brace1" name="FoldingEnd" />
- <DetectChar attribute="Error" context="#stay" char=")"/>
- </context>
-
- <context attribute="In Parenthesis" lineEndContext="#stay" name="parenthesis">
- <LineContinue attribute="Boolean" context="#stay"/>
- <DetectChar attribute="Keyword" context="#pop" char=")"/>
-
- <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
-
- <IncludeRules context="CommonRules"/>
- <DetectChar attribute="Error" context="#stay" char="}" />
- </context>
-
- <context attribute="String" lineEndContext="#stay" name="string">
- <DetectChar attribute="String" context="#pop" char="""/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- </context>
-
- <context attribute="Headline" lineEndContext="#pop" name="Headline"/>
- <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
-
- <!-- This context is not really used, but contains the common rules -->
- <context name="CommonRules">
- <DetectChar attribute="String" context="string" char="""/>
- <keyword attribute="Control Structure" context="#stay" String="controls"/>
- <keyword attribute="Reserved Words" context="#stay" String="words"/>
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Int" context="#stay"/>
- <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
- <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
- <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
- <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,2}|\^|@|\$|~)((?!(\+|\-|\*|/|<=|>=|=|\!=|\||&|:|\^|@|\$|~))|$)"/>
- <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,2}|\^|@|\$|~){2,}"/>
- <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
-
- <DetectChar attribute="Symbol" context="ctx0" char="{" beginRegion="Brace1" name="FoldingStart" />
- </context>
- </contexts>
-
- <itemDatas>
- <!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
- <itemData name="Normal Text" 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="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="String Char" defStyleNum="dsChar"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Int" defStyleNum="dsDecVal"/>
- </itemDatas>
-</highlighting>
-
-<general>
- <comments>
- <comment name="singleLine" start="#" end=""/>
- </comments>
- <keywords casesensitive="1" />
-</general>
-</language>
Deleted: trunk/rkward/rkward/rkward.xml
===================================================================
--- trunk/rkward/rkward/rkward.xml 2006-09-28 08:02:19 UTC (rev 772)
+++ trunk/rkward/rkward/rkward.xml 2006-09-28 08:09:39 UTC (rev 773)
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<!-- Kate 2.0 (KDE 3.0) highlighting module for RKWard
- version 0.2: (c) 2006 P. Ecochard
- lincense: GPL v2
- Based on the highlighting module for R version 0.4: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
-
- Kate : http://kate.kde.org/
- R : http://www.r-project.org/
- RKWard : http://rkward.sourceforge.net/
- -->
-<language version="0.2" kateversion="2.1" name="RKWard output" 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>
- </list>
- <list name="words">
- <item> TRUE </item>
- <item> FALSE </item>
- <item> NULL </item>
- <item> NA </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">
- <RegExpr attribute="Prompt" context="command0" String="^> " beginRegion="commandRegion"/>
- <RegExpr attribute="Normal Text" context="output" String="^([^>\+]|$)" lookAhead="true"/>
- </context>
-
- <!-- The output context does no highlighting. If a "> " is encountered at line start, pop back to ctxbase (and to command0 from there) -->
- <context attribute="Output" lineEndContext="#stay" name="output">
- <RegExpr attribute="Prompt" context="#pop" String="^> " lookAhead="true" endRegion="commandRegion"/>
- </context>
-
- <!-- The base level context in command mode. Does not allow closing '}' -->
- <context attribute="Normal Text" lineEndContext="#stay" name="command0">
- <IncludeRules context="CommandContinuationCheck"/>
- <IncludeRules context="CommonRules"/>
- <DetectChar attribute="Error" context="#stay" char="}" />
- <DetectChar attribute="Error" context="#stay" char=")"/>
- </context>
-
- <!-- A nested context in command mode. Closing '}' pops a level -->
- <context attribute="Normal Text" lineEndContext="#stay" name="command">
- <IncludeRules context="CommandContinuationCheck"/>
- <IncludeRules context="CommonRules"/>
- <DetectChar attribute="Symbol" context="#pop" char="}" />
- <DetectChar attribute="Error" context="#stay" char=")"/>
- </context>
-
- <context attribute="Normal Text" lineEndContext="#stay" name="parenthesis">
- <IncludeRules context="CommandContinuationCheck"/>
- <DetectChar attribute="Keyword" context="#pop" char=")"/>
-
- <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
-
- <IncludeRules context="CommonRules"/>
- <DetectChar attribute="Error" context="#stay" char="}" />
- </context>
-
- <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="Headline" lineEndContext="#pop" name="Headline"/>
- <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
-
- <!-- 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">
- <!-- Since this rule is included in every (relevant) context, this will unwind the entire context stack back to ctxbase. -->
- <RegExpr attribute="Prompt" context="#pop" String="^> " lookAhead="true" endRegion="commandRegion"/>
- <!-- See above -->
- <RegExpr attribute="Normal Text" context="#pop" String="^([^\+]|$)" lookAhead="true"/>
- <RegExpr attribute="Prompt" context="#stay" String="^\+ "/>
- </context>
-
- <!-- This context is not really used, but contains the common rules -->
- <context attribute="Normal Text" name="CommonRules">
- <DetectChar attribute="String" context="string" char="""/>
- <keyword attribute="Control Structure" context="#stay" String="controls"/>
- <keyword attribute="Reserved Words" context="#stay" String="words"/>
- <Float attribute="Float" context="#stay"/>
- <Int attribute="Int" context="#stay"/>
- <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
- <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
- <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
- <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,2}|\^|@|\$|~)((?!(\+|\-|\*|/|<=|>=|=|\!=|\||&|:|\^|@|\$|~))|$)"/>
- <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,2}|\^|@|\$|~){2,}"/>
- <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
-
- <!-- Contrary to the normal R Script highlighting, we don't start a region here, but we do go into a command sub-context -->
- <DetectChar attribute="Symbol" context="command" char="{" />
- </context>
- </contexts>
-
- <itemDatas>
- <itemData name="Output" defStyleNum="dsOthers"/>
- <!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
- <itemData name="Normal Text" 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="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="String Char" defStyleNum="dsChar"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <itemData name="Int" defStyleNum="dsDecVal"/>
- </itemDatas>
-</highlighting>
-
-<general>
- <comments>
- <comment name="singleLine" start="#" end=""/>
- </comments>
- <keywords casesensitive="1" />
-</general>
-</language>
Added: trunk/rkward/rkward/syntax/Makefile.am
===================================================================
--- trunk/rkward/rkward/syntax/Makefile.am (rev 0)
+++ trunk/rkward/rkward/syntax/Makefile.am 2006-09-28 08:09:39 UTC (rev 773)
@@ -0,0 +1,4 @@
+EXTRA_DIST = r-syntax-test.R
+
+katesyntaxdir = $(kde_datadir)/katepart/syntax/
+katesyntax_DATA = r.xml rkward.xml
Copied: trunk/rkward/rkward/syntax/r-syntax-test.R (from rev 755, trunk/rkward/rkward/r-syntax-test.R)
===================================================================
--- trunk/rkward/rkward/syntax/r-syntax-test.R (rev 0)
+++ trunk/rkward/rkward/syntax/r-syntax-test.R 2006-09-28 08:09:39 UTC (rev 773)
@@ -0,0 +1,49 @@
+## This is a Headline
+# This is a Comment
+
+myBoolean <- TRUE
+myNa <- NA
+
+myString <- "This is a String"
+"String 2" -> myString2
+myString3 <<- "global assignment"
+myString4 <- as.character( 3 + 4 )
+
+myMatrix <- matrix( 1:6, nrow = 3, ncol = 2 )
+myMatrix2 <- myMatrix + 4
+myMatrix3 <- t( myMatrix ) %*% myMatrix
+myMatrix[ myMatrix < 4 ] <- 0
+myMatrix[ myMatrix == 4 ] <- 10
+myFloat = 1.234
+myBooleanVector <- c( 1, 5 ) %in% c( 1, 2, 3, 4 )
+
+if( 3 > 4 ) {
+ stop( "Error: 3 is not graeter than 4!!!" )
+} else if( 3 == 4 ) {
+ stop( "Error: 3 is not equal to 4!!!" )
+}
+
+for( i in 2:5 ) {
+ print( paste( "No. ", as.character( i + ( 3 + i ) ), sep = "" ) )
+}
+
+try ( {
+ x <<- 1
+ x <<<- 1 # syntax error
+ x += 1 -= x1 *= x2 # syntax error
+ x =+ 1 =- x1 =* x2 # syntax error
+ "%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
+ ) # unexpected closing ')'
+ (}) # unexpected closing '}'
+},
+silent=FALSE)
+
+myList <- list( a = 1, a2 = 2, a2_b = 3 )
+
+x <- 1
+print ("hi", quote=(x==1))
+
+cat( "\nNo Errors!\n" )
Copied: trunk/rkward/rkward/syntax/r.xml (from rev 757, trunk/rkward/rkward/r.xml)
===================================================================
--- trunk/rkward/rkward/syntax/r.xml (rev 0)
+++ trunk/rkward/rkward/syntax/r.xml 2006-09-28 08:09:39 UTC (rev 773)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Kate 2.5 (KDE 3.5) highlighting module for R
+ based on an earlier version by E.L. Willighagen. Code folding code by Ben Goodrich
+ version 2.0: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
+ license: GPL v2
+ Kate : http://kate.kde.org/
+ R : http://www.r-project.org/
+ RKWard : http://rkward.sourceforge.net/
+ -->
+<language version="2.0" kateversion="2.5" name="R Script" section="Scripts"
+extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" 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>
+ </list>
+ <list name="words">
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> NULL </item>
+ <item> NA </item>
+ <item> Inf </item>
+ <item> NaN </item>
+ </list>
+
+ <contexts>
+ <!-- This context is really only good for detecting unexpected closing braces '}'. Since opening braces go to ctx0 (and nesting in there), this context is only active on the base level -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="level0">
+ <IncludeRules context="CommonRules"/>
+
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ctx0">
+ <IncludeRules context="CommonRules"/>
+
+ <DetectChar attribute="Symbol" context="#pop" char="}" endRegion="Brace1" name="FoldingEnd" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <context attribute="In Parenthesis" lineEndContext="#stay" name="parenthesis">
+ <LineContinue attribute="Boolean" context="#stay"/>
+ <DetectChar attribute="Keyword" context="#pop" char=")"/>
+
+ <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
+
+ <IncludeRules context="CommonRules"/>
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="string">
+ <DetectChar attribute="String" context="#pop" char="""/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ </context>
+
+ <context attribute="Headline" lineEndContext="#pop" name="Headline"/>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+
+ <!-- This context is not really used, but contains the common rules -->
+ <context name="CommonRules">
+ <DetectChar attribute="String" context="string" char="""/>
+ <keyword attribute="Control Structure" context="#stay" String="controls"/>
+ <keyword attribute="Reserved Words" context="#stay" String="words"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Int" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
+ <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,2}|\^|@|\$|~)((?!(\+|\-|\*|/|<=|>=|=|\!=|\||&|:|\^|@|\$|~))|$)"/>
+ <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,2}|\^|@|\$|~){2,}"/>
+ <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
+
+ <DetectChar attribute="Symbol" context="ctx0" char="{" beginRegion="Brace1" name="FoldingStart" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
+ <itemData name="Normal Text" 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="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="String Char" defStyleNum="dsChar"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Int" defStyleNum="dsDecVal"/>
+ </itemDatas>
+</highlighting>
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" end=""/>
+ </comments>
+ <keywords casesensitive="1" />
+</general>
+</language>
Copied: trunk/rkward/rkward/syntax/rkward.xml (from rev 757, trunk/rkward/rkward/rkward.xml)
===================================================================
--- trunk/rkward/rkward/syntax/rkward.xml (rev 0)
+++ trunk/rkward/rkward/syntax/rkward.xml 2006-09-28 08:09:39 UTC (rev 773)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Kate 2.0 (KDE 3.0) highlighting module for RKWard
+ version 0.2: (c) 2006 P. Ecochard
+ lincense: GPL v2
+ Based on the highlighting module for R version 0.4: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
+
+ Kate : http://kate.kde.org/
+ R : http://www.r-project.org/
+ RKWard : http://rkward.sourceforge.net/
+ -->
+<language version="0.2" kateversion="2.1" name="RKWard output" 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>
+ </list>
+ <list name="words">
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> NULL </item>
+ <item> NA </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">
+ <RegExpr attribute="Prompt" context="command0" String="^> " beginRegion="commandRegion"/>
+ <RegExpr attribute="Normal Text" context="output" String="^([^>\+]|$)" lookAhead="true"/>
+ </context>
+
+ <!-- The output context does no highlighting. If a "> " is encountered at line start, pop back to ctxbase (and to command0 from there) -->
+ <context attribute="Output" lineEndContext="#stay" name="output">
+ <RegExpr attribute="Prompt" context="#pop" String="^> " lookAhead="true" endRegion="commandRegion"/>
+ </context>
+
+ <!-- The base level context in command mode. Does not allow closing '}' -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="command0">
+ <IncludeRules context="CommandContinuationCheck"/>
+ <IncludeRules context="CommonRules"/>
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <!-- A nested context in command mode. Closing '}' pops a level -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="command">
+ <IncludeRules context="CommandContinuationCheck"/>
+ <IncludeRules context="CommonRules"/>
+ <DetectChar attribute="Symbol" context="#pop" char="}" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="parenthesis">
+ <IncludeRules context="CommandContinuationCheck"/>
+ <DetectChar attribute="Keyword" context="#pop" char=")"/>
+
+ <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
+
+ <IncludeRules context="CommonRules"/>
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ </context>
+
+ <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="Headline" lineEndContext="#pop" name="Headline"/>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+
+ <!-- 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">
+ <!-- Since this rule is included in every (relevant) context, this will unwind the entire context stack back to ctxbase. -->
+ <RegExpr attribute="Prompt" context="#pop" String="^> " lookAhead="true" endRegion="commandRegion"/>
+ <!-- See above -->
+ <RegExpr attribute="Normal Text" context="#pop" String="^([^\+]|$)" lookAhead="true"/>
+ <RegExpr attribute="Prompt" context="#stay" String="^\+ "/>
+ </context>
+
+ <!-- This context is not really used, but contains the common rules -->
+ <context attribute="Normal Text" name="CommonRules">
+ <DetectChar attribute="String" context="string" char="""/>
+ <keyword attribute="Control Structure" context="#stay" String="controls"/>
+ <keyword attribute="Reserved Words" context="#stay" String="words"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Int" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
+ <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,2}|\^|@|\$|~)((?!(\+|\-|\*|/|<=|>=|=|\!=|\||&|:|\^|@|\$|~))|$)"/>
+ <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|<=|>=|={1,2}|\!=|\|{1,2}|&{1,2}|:{1,2}|\^|@|\$|~){2,}"/>
+ <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
+
+ <!-- Contrary to the normal R Script highlighting, we don't start a region here, but we do go into a command sub-context -->
+ <DetectChar attribute="Symbol" context="command" char="{" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Output" defStyleNum="dsOthers"/>
+ <!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
+ <itemData name="Normal Text" 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="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="String Char" defStyleNum="dsChar"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Int" defStyleNum="dsDecVal"/>
+ </itemDatas>
+</highlighting>
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" end=""/>
+ </comments>
+ <keywords casesensitive="1" />
+</general>
+</language>
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