[Sciviews-commits] r135 - in pkg: svMisc/R svSocket/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri May 29 11:26:24 CEST 2009
Author: phgrosjean
Date: 2009-05-29 11:26:22 +0200 (Fri, 29 May 2009)
New Revision: 135
Modified:
pkg/svMisc/R/Parse.R
pkg/svSocket/man/processSocket.Rd
Log:
Parse() and repl(), further changes
Modified: pkg/svMisc/R/Parse.R
===================================================================
--- pkg/svMisc/R/Parse.R 2009-05-28 11:45:43 UTC (rev 134)
+++ pkg/svMisc/R/Parse.R 2009-05-29 09:26:22 UTC (rev 135)
@@ -12,8 +12,14 @@
# Determine if this code is correctly parsed
if (inherits(expr, "try-error")) {
# Determine if it is incorrect code, or incomplete line!
- toSearch <- paste(": ", length(strsplit(text, "\n")[[1]]) +
- 1, ":0:", sep = "")
+ # Code is different before and after R 2.9.0
+ if (compareRVersion("2.9.0") < 0) {
+ toSearch <- paste("\n", length(strsplit(text, "\n")[[1]]) +
+ 1, ":", sep = "")
+ } else {
+ toSearch <- paste(": ", length(strsplit(text, "\n")[[1]]) +
+ 1, ":0:", sep = "")
+ }
if (length(grep(toSearch, expr)) == 1) return(NA) else return(expr)
}
# There is still a case of incomplete code not catch: incomplete strings
Modified: pkg/svSocket/man/processSocket.Rd
===================================================================
--- pkg/svSocket/man/processSocket.Rd 2009-05-28 11:45:43 UTC (rev 134)
+++ pkg/svSocket/man/processSocket.Rd 2009-05-29 09:26:22 UTC (rev 135)
@@ -82,7 +82,7 @@
repl <- function ()
{
pars <- parSocket("repl", "", bare = FALSE) # Parameterize the loop
- cat("Enter R code, hit <ESC> to exit\n> ") # First prompt
+ cat("Enter R code, hit <CTRL-C> or <ESC> to exit\n> ") # First prompt
repeat {
entry <- readLines(n = 1) # Read a line of entry
if (entry == "") entry <- "<<<esc>>>" # Exit from multiline mode
More information about the Sciviews-commits
mailing list