Skip to content

Commit 2eb8ef5

Browse files
authored
Merge pull request #1159 from stan-dev/sync-pound-cran
Remove # processing to match CRAN RStan
2 parents f9a6372 + f6c8e0b commit 2eb8ef5

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

Diff for: .github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
2525

2626
strategy:
27-
fail-fast: true
27+
fail-fast: false
2828
matrix:
2929
config:
3030
- {os: macOS-latest, r: 'devel'}

Diff for: rstan/rstan/R/stanc.R

+1-22
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,7 @@ stanc_process <- function(file, model_code = '', model_name = "anon_model",
8383
}
8484

8585
model_code <- gsub('#include /(.*$)', '#include "\\1"', model_code)
86-
has_pound <- any(grepl("#", model_code, fixed = TRUE))
87-
88-
if (has_pound && isFALSE(auto_format)) {
89-
unprocessed <- tempfile(fileext = ".stan")
90-
processed <- tempfile(fileext = ".stan")
91-
on.exit(file.remove(unprocessed))
92-
writeLines(model_code, con = unprocessed)
93-
ARGS <- paste("-E -nostdinc -x c++ -P -C",
94-
paste("-I", isystem, " ", collapse = ""),
95-
"-o", processed, unprocessed, "-Wno-invalid-pp-token")
96-
CPP <- system2(file.path(R.home(component = "bin"), "R"),
97-
args = "CMD config CC", stdout = TRUE)
98-
pkgbuild::with_build_tools(system(paste(CPP, ARGS),
99-
ignore.stdout = TRUE, ignore.stderr = TRUE),
100-
required = rstan_options("required") &&
101-
identical(Sys.getenv("WINDOWS"), "TRUE") &&
102-
!identical(Sys.getenv("R_PACKAGE_SOURCE"), "") )
103-
if (file.exists(processed)) {
104-
on.exit(file.remove(processed), add = TRUE)
105-
model_code <- paste(readLines(processed), collapse = "\n")
106-
}
107-
} else model_code <- paste(model_code, collapse = "\n")
86+
model_code <- paste(model_code, collapse = "\n")
10887

10988
mostattributes(model_code) <- model_attr
11089

0 commit comments

Comments
 (0)