Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions R/parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ get_parse_data <- function(text, include_text = TRUE, ...) {
# avoid https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16041
parse_safely(text, keep.source = TRUE)
parsed <- parse_safely(text, keep.source = TRUE)
pd <- styler_df(
utils::getParseData(parsed, includeText = include_text),
.name_repair = "minimal"
)
pd <- utils::getParseData(parsed, includeText = include_text) %>%
styler_df()
if (getRversion() < "4.2") {
is_unicode_parsing_error <- grepl("^\"<U\\+[0-9]+>\"$", pd$text)
if (any(is_unicode_parsing_error)) {
Expand Down Expand Up @@ -163,7 +161,7 @@ ensure_correct_txt <- function(pd, text) {
by.y = "id",
suffixes = c("", "parent")
) %>%
styler_df(.name_repair = "minimal")
styler_df()

if (!lines_and_cols_match(new_text)) {
abort(paste(
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ line_col_names <- function() {
#' Wrapper functions to encapsulate data frame creation
#' @keywords internal
#' @noRd
styler_df <- function(..., .size = NULL, .name_repair = "minimal") {
vctrs::data_frame(..., .size = .size, .name_repair = .name_repair)
styler_df <- function(...) {
vctrs::data_frame(..., .name_repair = "minimal")
}

#' @keywords internal
Expand Down