Skip to content

Commit 839fca6

Browse files
committed
move code2list to teal.data
1 parent 76b0dd8 commit 839fca6

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

R/utils-get_code_dependency.R

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -463,31 +463,6 @@ split_code <- function(code) {
463463
gsub("^([[:space:]])*;(.+)$", "\\1\\2", new_code, perl = TRUE)
464464
}
465465

466-
467-
#' Reshape code to the list
468-
#'
469-
#' List will be divided by the calls. Each element of the list contains `id` and `dependency` attributes.
470-
#'
471-
#' @param code `character` with the code.
472-
#'
473-
#' @return list of `character`s of the length equal to the number of calls in `code`.
474-
#'
475-
#' @keywords internal
476-
#' @noRd
477-
code2list <- function(code) {
478-
checkmate::assert_character(code, null.ok = TRUE)
479-
if (length(code)) {
480-
lapply(split_code(code), function(current_code) {
481-
attr(current_code, "id") <- sample.int(.Machine$integer.max, 1)
482-
parsed_code <- parse(text = trimws(current_code), keep.source = TRUE)
483-
attr(current_code, "dependency") <- extract_dependency(parsed_code)
484-
current_code
485-
})
486-
} else {
487-
list(character(0))
488-
}
489-
}
490-
491466
#' @param parsed_code results of `parse(text = code, keep.source = TRUE` (parsed text)
492467
#' @keywords internal
493468
#' @noRd

0 commit comments

Comments
 (0)