Skip to content

Commit

Permalink
Better function name
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Nov 4, 2024
1 parent 68a5cc6 commit 7f4c1fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/scan-deps-queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ q_library_0 <- function() {
), names = rep("q_library_0", 2))
}

q_import <- function() {
q_module_import <- function() {
c(
'((call function: (identifier) @fn-name) @dep-code
(#any-of? @fn-name "import"))',
Expand Down
2 changes: 1 addition & 1 deletion R/scan-deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ parse_pkg_from_call_modules_import <- function(ns, fn, matched) {
parse_pkg_from_call_modules_module <- function(ns, fn, matched) {
if (!is.na(ns) && ns != "modules") return(NULL)
expr <- as.character(matched[["expr"]])
hits <- code_query(expr, q_import())[["matched_captures"]]
hits <- code_query(expr, q_module_import())[["matched_captures"]]
code <- hits$code[hits$name == "dep-code"]
pkgs <- lapply(seq_along(code), function(i) {
safe_parse_pkg_from_call(ns, "import", code[i])
Expand Down

0 comments on commit 7f4c1fa

Please sign in to comment.