Skip to content

Commit

Permalink
Stray changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Aug 9, 2023
1 parent 2909cc1 commit 779c92f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -872,16 +872,16 @@ compile_functions <- function(env, verbose = FALSE, global = FALSE) {
funs <- grep("// [[stan::function]]", env$hpp_code, fixed = TRUE)
funs <- c(funs, length(env$hpp_code))

env$fun_names <- sapply(seq_len(length(funs) - 1), function(ind) {
get_function_name(funs[ind], funs[ind + 1], env$hpp_code)
})

stan_funs <- sapply(seq_len(length(funs) - 1), function(ind) {
fun_end <- funs[ind + 1]
fun_end <- ifelse(env$hpp_code[fun_end] == "}", fun_end, fun_end - 1)
prep_fun_cpp(funs[ind], fun_end, env$hpp_code)
})

env$fun_names <- sapply(seq_len(length(funs) - 1), function(ind) {
get_function_name(funs[ind], funs[ind + 1], env$hpp_code)
})

dups <- env$fun_names[duplicated(env$fun_names)]

if (length(dups) > 0) {
Expand All @@ -897,7 +897,6 @@ compile_functions <- function(env, verbose = FALSE, global = FALSE) {
"// [[Rcpp::depends(RcppEigen)]]",
stan_funs),
collapse = "\n")

if (global) {
rcpp_source_stan(mod_stan_funs, globalenv(), verbose)
} else {
Expand Down

0 comments on commit 779c92f

Please sign in to comment.