Skip to content

Commit

Permalink
Improves how functions are processed
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Dec 9, 2024
1 parent 3c5c118 commit f18fc0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/translate-roxygen.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ translate_roxygen_imp <- function(path,
pkg_env <- env_package(pkg_path)
}
current_roxy <- roxy_comments(path)
if(is.null(current_roxy)) {
if (is.null(current_roxy)) {
cli_inform("[{no}/{of}] {path} --> [Skipping, no content]")
return(invisible())
}
Expand Down Expand Up @@ -133,11 +133,11 @@ translate_roxygen_imp <- function(path,
raw <- gsub("\n", "\n#' ", raw)
contents <- c(contents, raw)
}
roxy_call <- as.character(roxy$call)
if (length(roxy_call) == 3) {
fn_str <- paste(roxy_call[[2]], roxy_call[[1]], roxy_call[[3]])
} else {
fn_str <- paste0("\"", roxy_call, "\"")
roxy_call <- capture.output(roxy$call)
fn_str <- paste0(roxy_call, collapse = "")
if (grepl("[{]", fn_str) && grepl("[}]", fn_str)) {
fn_str <- unlist(strsplit(fn_str, "[{]"))[[1]]
fn_str <- paste0(fn_str, "{ NULL }")
}
contents <- c(contents, fn_str)
}
Expand Down

0 comments on commit f18fc0e

Please sign in to comment.