Skip to content

Commit 9dfc3e7

Browse files
m7praverissimo
andauthored
Update R/utils-get_code_dependency.R
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
1 parent 801734b commit 9dfc3e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/utils-get_code_dependency.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ fix_shifted_comments <- function(calls) {
148148
#' Fixes edge case of `:=` assignment operator being treated as assignment.
149149
#' @keywords internal
150150
#' @noRd
151-
remove_dt_assign <- function(calls) {
151+
remove_custom_assign <- function(calls, exclude = c(":=")) {
152152
checkmate::assert_list(calls)
153+
checkmate::assert_character(exclude)
153154
lapply(calls, function(call) {
154-
call <- subset(call, !(token == "LEFT_ASSIGN" & text == ":="))
155+
call[!(call$token == "LEFT_ASSIGN" & call$text %in% exclude), ]
155156
})
156157
}
157158

0 commit comments

Comments
 (0)