From ede935527f191569cddfa76c96818b6e912413a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:12:07 +0100 Subject: [PATCH] fix: regex expression to only replace if initial and ending backticks exist --- R/utils-get_code_dependency.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utils-get_code_dependency.R b/R/utils-get_code_dependency.R index f1f9dd9c6..762d131d8 100644 --- a/R/utils-get_code_dependency.R +++ b/R/utils-get_code_dependency.R @@ -381,8 +381,8 @@ extract_side_effects <- function(calls_pd) { #' @noRd graph_parser <- function(x, graph) { # normalize x to remove surrounding backticks - x <- gsub("^`|`$", "", x) - graph <- lapply(graph, function(call) gsub("^`|`$", "", call)) + x <- gsub("^`(.*)`$", "\\1", x) + graph <- lapply(graph, function(call) gsub("^`(.*)`$", "\\1", call)) occurrence <- vapply( graph, function(call) {