Skip to content

Commit

Permalink
keep.source always FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
meztez committed Nov 18, 2023
1 parent 57553bd commit bc307e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/utf8.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ parseUTF8 <- function(file) {
# **can** be encoded natively on Windows (might be a bug in base R); we
# rewrite the source code in a natively encoded temp file and parse it in this
# case (the source reference is still pointed to the original file, though)
keepsource <- TRUE
if (isWindows() && enc == 'unknown') {
file <- tempfile(); on.exit(unlink(file), add = TRUE)
writeLines(lines, file)
keepsource <- FALSE
}

# keep the source locations within the file while parsing
exprs <- try(parse(file, keep.source = keepsource, srcfile = src, encoding = enc))
exprs <- try(parse(file, keep.source = FALSE, srcfile = src, encoding = enc))
if (inherits(exprs, "try-error")) {
stop("Error sourcing ", file)
}
Expand Down

0 comments on commit bc307e5

Please sign in to comment.