Skip to content

Commit

Permalink
ficed a bug in variable declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 5, 2023
1 parent 4a4d703 commit 49c617f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/mainclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ generateNewName <- function(name, extension, delimiter, vars) {

varsDeclaration <- function(vars, types) {
stopifnot(length(vars) == length(types))
if(length(vars) == 0) return("")
l <- list()
for(i in seq_along(1:length(vars))) {
l[[i]] <- cString("\t ", cString(types[[i]], deparse(vars[[i]]), " ")@value, ";\n", "")@value
Expand Down Expand Up @@ -374,6 +375,9 @@ buildFctR <- function(fct, nameFct) {
"// [[Rcpp::export]]\n", "\n")
sig <- signatureR(ac$args, nameFct, ac$var_all)
hs <- handleSEXP(ac$args, sig[[2]])
if(!ac$return_TF) {
ac$char <- c(ac$char, "\n", "return(R_NilValue); \n")
}
b <- buildBody(ac$char)
f <- cString(f, sig[[1]], hs, declarations, b, "}\n", "")
return(f@value)
Expand Down

0 comments on commit 49c617f

Please sign in to comment.