Skip to content

Commit

Permalink
simplify in_parenthesis function
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Feb 6, 2024
1 parent 80184de commit 035a65c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions R/utils-get_code_dependency.R
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,7 @@ extract_occurrence <- function(calls_pd) {
if (any(x$token == "LBB")) {
id_start <- min(x$id[x$token == "LBB"])
id_end <- min(x$id[x$token == "']'"])
in_parenthesis <- x$token == "SYMBOL" & x$id > id_start & x$id < id_end
if (any(in_parenthesis)) {
x$text[in_parenthesis]
} else {
character(0)
}
x$text[x$token == "SYMBOL" & x$id > id_start & x$id < id_end]
}
}
lapply(
Expand Down

0 comments on commit 035a65c

Please sign in to comment.