@@ -16,11 +16,6 @@ parse_all <- function(x, filename = NULL, allow_error = FALSE) UseMethod("parse_
16
16
17
17
# ' @export
18
18
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
-
24
19
if (length(grep(" \n " , x ))) {
25
20
# strsplit('a\n', '\n') needs to return c('a', '') instead of c('a')
26
21
x <- gsub(" \n $" , " \n\n " , x )
@@ -114,18 +109,6 @@ append_break <- function(x) {
114
109
if (n < = 1 ) x else paste(x , rep(c(" \n " , " " ), c(n - 1 , 1 )), sep = " " )
115
110
}
116
111
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
-
129
112
# ' @export
130
113
parse_all.connection <- function (x , filename = NULL , ... ) {
131
114
if (! isOpen(x , " r" )) {
0 commit comments