[rkward] packages/rkwarddev/R: fixed code layout

m.eik michalke meik.michalke at uni-duesseldorf.de
Sat Nov 14 23:43:05 UTC 2015


Git commit a88fc00811a13721184fea8d36e3808800d3b348 by m.eik michalke.
Committed on 14/11/2015 at 23:41.
Pushed by meikm into branch 'master'.

fixed code layout

  - the new default for "linebreaks" in js() had an unwanted effect on recursion

M  +6    -5    packages/rkwarddev/R/rk-internal.R

http://commits.kde.org/rkward/a88fc00811a13721184fea8d36e3808800d3b348

diff --git a/packages/rkwarddev/R/rk-internal.R b/packages/rkwarddev/R/rk-internal.R
index 85de952..37c4e13 100644
--- a/packages/rkwarddev/R/rk-internal.R
+++ b/packages/rkwarddev/R/rk-internal.R
@@ -1531,7 +1531,7 @@ uncurl <- function(cond, level=1, indent.by=rk.get.indent()){
           sapply(
             2:length(cond.list),
             function(this.cond.num){
-              do.call("js", args=list(cond[[this.cond.num]], level=level, by=indent.by))
+              do.call("js", args=list(cond[[this.cond.num]], level=level, by=indent.by, linebreaks=FALSE))
             }
           ),
           collapse=paste0("\n", indent(level=level, by=indent.by))
@@ -1540,7 +1540,7 @@ uncurl <- function(cond, level=1, indent.by=rk.get.indent()){
         cond <- ""
       }
     } else {
-      cond <- do.call("js", args=list(cond, level=level, by=indent.by))
+      cond <- do.call("js", args=list(cond, level=level, by=indent.by, linebreaks=FALSE))
     }
   } else {}
   return(cond)
@@ -1649,7 +1649,7 @@ replaceJSFor <- function(loop, level=1, indent.by=rk.get.indent()){
     loop <- paste(
       paste0(indent(level=level, by=indent.by), "// the variable names \"", arrayName, "\" and \"", iterName, "\" were randomly generated"),
       paste0("var ", arrayName, " = new Array();"),
-      paste0(arrayName, ".push(", do.call("js", args=list(loop[[3]], level=level, indent.by=indent.by)), ");"),
+      paste0(arrayName, ".push(", do.call("js", args=list(loop[[3]], level=level, indent.by=indent.by, linebreaks=FALSE)), ");"),
       paste0("for (var ", as.character(loop[[2]]), "=", arrayName, "[0], ", iterName, "=0; ",
         iterName, " < ", arrayName, ".length; ",
         iterName, "++, ", as.character(loop[[2]]), "=", arrayName, "[", iterName, "]) {"),
@@ -1660,7 +1660,8 @@ replaceJSFor <- function(loop, level=1, indent.by=rk.get.indent()){
           args=list(
             uncurl(loop[[4]], level=level+1, indent.by=indent.by),
             level=level,
-            indent.by=indent.by
+            indent.by=indent.by,
+            linebreaks=FALSE
           )
         )
       ),
@@ -1668,7 +1669,7 @@ replaceJSFor <- function(loop, level=1, indent.by=rk.get.indent()){
       sep=paste0("\n", indent(level=level, by=indent.by))
     )
   } else {
-    loop <- do.call("js", args=list(loop, level=level, indent.by=indent.by))
+    loop <- do.call("js", args=list(loop, level=level, indent.by=indent.by, linebreaks=FALSE))
     return(loop)
   }
 } ## end function replaceJSFor



More information about the rkward-tracker mailing list