[kepler-dev] [Bug 4010] - RExpression2 - tracking for backwards compatibility

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Thu Aug 27 14:06:55 PDT 2009


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4010





------- Comment #5 from leinfelder at nceas.ucsb.edu  2009-08-27 14:06 -------
Testing JRI with the SANParks TPC workflows. Because of how the R code is sent
to JRI and executed, we have to do some parsing of the script before sending
"lines" of code to the JRI library. So far these are the problems that I've
encountered:

-comments need to be stripped out. this is easy for lines that are comprised
completely of comments but is tricky when the # character appears inside a
quoted string (valid in R). I seem to have a good regex to handle most cases of
this correctly (but it's still something to watch for as the R code gets more
and more advanced)

-nested code (if/else, function definitions, etc...) that use {} need to be
consolidated into a single "line" but with each statement delimited by ; i have
it working for this coding style:
if (true) {
  i <- 1
}
else {
  i <- 2
}
but need to support alternate syntax like:
if (true) {
  i <- 1
} else {
  i <- 2
}

-function calls or other code that can be broken into multiple lines for
readability are not currently supported - that means lines can get very wide
(and copying and pasting formatted valid R code from your favorite editor can
break it big time)


More information about the Kepler-dev mailing list