[Sciviews-commits] r71 - pkg/svTools/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Nov 4 11:34:45 CET 2008
Author: romain
Date: 2008-11-04 11:34:45 +0100 (Tue, 04 Nov 2008)
New Revision: 71
Modified:
pkg/svTools/R/sidekick.R
Log:
forcing integers
Modified: pkg/svTools/R/sidekick.R
===================================================================
--- pkg/svTools/R/sidekick.R 2008-11-03 14:02:45 UTC (rev 70)
+++ pkg/svTools/R/sidekick.R 2008-11-04 10:34:45 UTC (rev 71)
@@ -23,7 +23,16 @@
}
### calls the actual sidekick function
- sidekickParse( p )
+ out <- sidekickParse( p )
+ # TODO: replace this in the code so that no conversion is necessary at that point
+
+ out$id <- as.integer( out$id )
+ out$srcref1 <- as.integer( out$srcref1 )
+ out$srcref2 <- as.integer( out$srcref2 )
+ out$srcref3 <- as.integer( out$srcref3 )
+ out$srcref4 <- as.integer( out$srcref4 )
+ out$parent <- as.integer( out$parent )
+ out
}
@@ -31,13 +40,13 @@
if( top ) {
env[["data"]] <- data.frame(
- id = numeric(0),
- srcref1 = numeric(0),
- srcref2 = numeric(0),
- srcref3 = numeric(0),
- srcref4 = numeric(0),
+ id = integer(0),
+ srcref1 = integer(0),
+ srcref2 = integer(0),
+ srcref3 = integer(0),
+ srcref4 = integer(0),
description = character(0),
- parent = numeric(0),
+ parent = integer(0),
mode = character(0), stringsAsFactors = FALSE )
if( p %of% "try-error" ){
return( env[["data"]] )
@@ -94,17 +103,7 @@
env[["data"]][ ids[i], "mode" ] <- "function"
try( sidekickParse( p[[i]], top = FALSE, env = env, parent = if( hasAttrs) ids[i] else parent ), silent = TRUE )
} else {
- # test <- try( looksLikeAnIf( p[[i]] ), silent = TRUE )
- # if( ! test %of% "try-error" && test ){
- # pa <- try( addIfNode( TRUE, env = env, parent = if( hasAttrs ) ids[i] else parent, p[[i]][[3]] ), silent = TRUE )
- # sidekickParse( p[[i]][[3]], top = FALSE, env = env, parent = pa )
- # if( length(p[[i]]) == 4){
- # pa <- try( addIfNode( FALSE, env = env, parent = if( hasAttrs ) ids[i] else parent, p[[i]][[4]] ), silent = TRUE )
- # sidekickParse( p[[i]][[4]] , top = FALSE, env = env, parent = pa )
- # }
- # } else{
sidekickParse( p[[i]], top = FALSE, env = env, parent = if( hasAttrs) ids[i] else parent )
- # }
}
}
}
More information about the Sciviews-commits
mailing list