Skip to content

Commit 50c3c6f

Browse files
authored
Merge pull request #1115 from sbfnk/develop
Catch last space in regex in `expose_stan_functions`
2 parents c44402a + 0d5d50f commit 50c3c6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rstan/rstan/R/expose_stan_functions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ expose_stan_functions_hacks <- function(code, includes = NULL) {
3030
code, sep = "\n")
3131
code <- gsub("// [[stan::function]]",
3232
"// [[Rcpp::export]]", code, fixed = TRUE)
33-
code <- gsub("stan::math::accumulator<double>& lp_accum__,(\\n)?(\\s*)?std::ostream\\*(\\n)?(\\s*)?pstream__(\\n)?(\\s*)?=(\\n)?\\s*)?(nullptr|0))(\\s*)?\\{",
33+
code <- gsub("stan::math::accumulator<double>&(\\s*)?lp_accum__,(\\n)?(\\s*)?std::ostream\\*(\\n)?(\\s*)?pstream__(\\n)?(\\s*)?=(\\n)?\\s*)?(nullptr|0))(\\s*)?\\{",
3434
"std::ostream* pstream__ = nullptr){\nstan::math::accumulator<double> lp_accum__;",
3535
code)
3636
code <- gsub("pstream__(\\s*|)=(\\s*|)nullptr", "pstream__ = 0", code)

0 commit comments

Comments
 (0)