[Rinside-commits] r262 - in pkg: . inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 11 04:04:23 CEST 2012


Author: edd
Date: 2012-10-11 04:04:21 +0200 (Thu, 11 Oct 2012)
New Revision: 262

Modified:
   pkg/ChangeLog
   pkg/inst/NEWS.Rd
   pkg/inst/THANKS
   pkg/src/RInside.cpp
Log:
commit simplified / modified patch by Theodore Lytras which gets us (some) error tolerance


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2012-09-16 14:21:22 UTC (rev 261)
+++ pkg/ChangeLog	2012-10-11 02:04:21 UTC (rev 262)
@@ -1,3 +1,8 @@
+2012-10-10  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/RInside.cpp: Applied (modified) patch by Theodore Lytras which
+	lets us recover from parsing errors on erroneous input lines
+
 2012-09-15  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/RInside.cpp (initialize): On Windows, if R_HOME is not set as

Modified: pkg/inst/NEWS.Rd
===================================================================
--- pkg/inst/NEWS.Rd	2012-09-16 14:21:22 UTC (rev 261)
+++ pkg/inst/NEWS.Rd	2012-10-11 02:04:21 UTC (rev 262)
@@ -10,6 +10,9 @@
     library build of libRinside
     \item On Windows, have RInside use R's get_R_HOME() function to get
     R_HOME value from registry if not set by user
+    \item Applied (modified) patch by Theodore Lytras which lets RInside
+    recover from some parsing errors and makes RInside applications more
+    tolerant of errors
   }
 }
 \section{Changes in RInside version 0.2.8 (2012-09-07)}{

Modified: pkg/inst/THANKS
===================================================================
--- pkg/inst/THANKS	2012-09-16 14:21:22 UTC (rev 261)
+++ pkg/inst/THANKS	2012-10-11 02:04:21 UTC (rev 262)
@@ -11,3 +11,4 @@
 James Bates		for a patch restoring RInside on Windows
 John Brzustowski	for a correction to the Windows initialization
 Peter Aberline		for contributing CMake support for all examples
+Theodore Lytras		for a patch helping to recover from (some) errors

Modified: pkg/src/RInside.cpp
===================================================================
--- pkg/src/RInside.cpp	2012-09-16 14:21:22 UTC (rev 261)
+++ pkg/src/RInside.cpp	2012-10-11 02:04:21 UTC (rev 262)
@@ -329,10 +329,10 @@
         // Loop is needed here as EXPSEXP might be of length > 1
         for(i = 0; i < Rf_length(cmdexpr); i++){
             ans = R_tryEval(VECTOR_ELT(cmdexpr, i), global_env_m, &errorOccurred);
-            // NB: we never actually get here if interactice is set to FALSE as it is above
             if (errorOccurred) {
-                Rf_error("%s: Error in evaluating R code (%d)\n", programName, status);
+                Rf_warning("%s: Error in evaluating R code (%d)\n", programName, status);
                 UNPROTECT(2);
+                mb_m.rewind();
                 return 1;
             }
             if (verbose_m) {
@@ -345,21 +345,24 @@
         // need to read another line
         break;
     case PARSE_NULL:
-        Rf_error("%s: ParseStatus is null (%d)\n", programName, status);
+        Rf_warning("%s: ParseStatus is null (%d)\n", programName, status);
         UNPROTECT(2);
+        mb_m.rewind();
         return 1;
         break;
     case PARSE_ERROR:
-        Rf_error("Parse Error: \"%s\"\n", line.c_str());
+        Rf_warning("Parse Error: \"%s\"\n", line.c_str());
         UNPROTECT(2);
+        mb_m.rewind();
         return 1;
         break;
     case PARSE_EOF:
-        Rf_error("%s: ParseStatus is eof (%d)\n", programName, status);
+        Rf_warning("%s: ParseStatus is eof (%d)\n", programName, status);
         break;
     default:
-        Rf_error("%s: ParseStatus is not documented %d\n", programName, status);
+        Rf_warning("%s: ParseStatus is not documented %d\n", programName, status);
         UNPROTECT(2);
+        mb_m.rewind();
         return 1;
         break;
     }



More information about the Rinside-commits mailing list