[Sciviews-commits] r141 - pkg/svTools/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 6 11:42:33 CEST 2009


Author: romain
Date: 2009-06-06 11:42:33 +0200 (Sat, 06 Jun 2009)
New Revision: 141

Modified:
   pkg/svTools/R/parseError.R
Log:
minor fixes in svTools (sidekick)

Modified: pkg/svTools/R/parseError.R
===================================================================
--- pkg/svTools/R/parseError.R	2009-06-06 09:30:45 UTC (rev 140)
+++ pkg/svTools/R/parseError.R	2009-06-06 09:42:33 UTC (rev 141)
@@ -6,13 +6,17 @@
 #' @return A data.frame with the following columns : file, line, message and type
 #' @author Romain Francois \email{francoisromain@@free.fr}
 parseError <- function( err ){
-  msg <- err %/~% "\\\n"
-  rx   <- "^.*?: (.*?):(.*?):(.*?):(.*)$"
-  file <- sub( rx, "\\1", msg[1], perl = TRUE )
-  line <- sub( rx, "\\2", msg[1], perl = TRUE )
-  col  <- sub( rx, "\\3", msg[1], perl = TRUE )
-  message <- sub( rx, "\\4", msg[1], perl = TRUE )
+  msg     <- err %/~% "\\\n"
+  line.nb <- msg %~% "^\\d+"
+  msg     <- msg[ 1:( min( which( line.nb) ) - 1) ]
+  msg     <- paste( msg, collapse = "" )
   
+  rx      <- "^.*?: (.*?):(.*?):(.*?):(.*)$"
+  file    <- sub( rx, "\\1", msg, perl = TRUE )
+  line    <- sub( rx, "\\2", msg, perl = TRUE )
+  col     <- sub( rx, "\\3", msg, perl = TRUE )
+  message <- sub( rx, "\\4", msg, perl = TRUE )
+  
   data.frame( file = file, 
     line = line, message = message, 
     type = "error", stringsAsFactors = FALSE )



More information about the Sciviews-commits mailing list