Skip to content

Commit 9dcfe92

Browse files
authored
Drop unused code since we require R 4.0.0 (#130)
1 parent ccbc79d commit 9dcfe92

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

R/parse.R

-17
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ parse_all <- function(x, filename = NULL, allow_error = FALSE) UseMethod("parse_
1616

1717
#' @export
1818
parse_all.character <- function(x, filename = NULL, allow_error = FALSE) {
19-
20-
# Do not convert strings to factors by default in data.frame()
21-
op <- options(stringsAsFactors = FALSE)
22-
on.exit(options(op), add = TRUE)
23-
2419
if (length(grep("\n", x))) {
2520
# strsplit('a\n', '\n') needs to return c('a', '') instead of c('a')
2621
x <- gsub("\n$", "\n\n", x)
@@ -114,18 +109,6 @@ append_break <- function(x) {
114109
if (n <= 1) x else paste(x, rep(c("\n", ""), c(n - 1, 1)), sep = "")
115110
}
116111

117-
# YX: This hack is because srcfilecopy() uses grepl("\n", fixed = TRUE), which
118-
# does not work when the source lines contain multibyte characters that are not
119-
# representable in the current locale on Windows (see
120-
# https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16264). In our case, we
121-
# have already split the lines by \n, so there is no need to do that again like
122-
# srcfilecopy() does internally.
123-
if (getRversion() <= '3.2.2') srcfilecopy <- function(filename, lines, ...) {
124-
src <- base::srcfilecopy(filename, lines = "", ...)
125-
src$lines <- lines
126-
src
127-
}
128-
129112
#' @export
130113
parse_all.connection <- function(x, filename = NULL, ...) {
131114
if (!isOpen(x, "r")) {

tests/testthat/test-errors.R

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ test_that("traceback useful if stop_on_error == 2L", {
2626
})
2727

2828
test_that("capture messages in try() (#88)", {
29-
skip_if(getRversion() < "3.4")
30-
3129
ev <- evaluate(file("try.R"))
3230
expect_match(ev[[length(ev)]], "Obscure error")
3331
})

0 commit comments

Comments
 (0)