From ec3b12b9378b3faa16bf8be2b351eee145c077ce Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Mar 2026 22:56:44 +0000 Subject: [PATCH] Fix regexec() calls: remove perl=TRUE unsupported in older R regexec() only gained the perl argument in R 4.1.0. The CI matrix covers oldrel-1 through oldrel-4 (R 3.x/4.0.x), so perl=TRUE caused an 'unused argument' error on every message_() call in those environments. All four affected regexec() calls use POSIX-extended compatible patterns, so dropping perl=TRUE is safe. https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b --- R/aa_helper_functions.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 0a46cc2d8..776609e26 100644 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -433,7 +433,7 @@ cli_to_plain <- function(msg, envir = parent.frame()) { apply_sub <- function(msg, pattern, formatter) { while (grepl(pattern, msg, perl = TRUE)) { - m <- regexec(pattern, msg, perl = TRUE) + m <- regexec(pattern, msg) matches <- regmatches(msg, m)[[1]] if (length(matches) < 2L) break full_match <- matches[1L] @@ -462,12 +462,12 @@ cli_to_plain <- function(msg, envir = parent.frame()) { msg <- apply_sub(msg, "\\{\\.emph (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("*", resolve(c), "*")) msg <- apply_sub(msg, "\\{\\.help ([^}]+)\\}", function(c) { # Handle [display text](topic) markdown link format: extract just the display text - m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c, perl = TRUE))[[1L]] + m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c))[[1L]] if (length(m) >= 2L) m[2L] else paste0("`", resolve(c), "`") }) msg <- apply_sub(msg, "\\{\\.topic ([^}]+)\\}", function(c) { # Handle [display text](topic) markdown link format: extract just the display text - m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c, perl = TRUE))[[1L]] + m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c))[[1L]] if (length(m) >= 2L) m[2L] else paste0("?", resolve(c)) }) msg <- apply_sub(msg, "\\{\\.url (\\{[^}]+\\}|[^}]+)\\}", function(c) resolve(c)) @@ -475,7 +475,7 @@ cli_to_plain <- function(msg, envir = parent.frame()) { # bare {variable} or {expression} -> evaluate in caller's environment while (grepl("\\{[^{}]+\\}", msg)) { - m <- regexec("\\{([^{}]+)\\}", msg, perl = TRUE) + m <- regexec("\\{([^{}]+)\\}", msg) matches <- regmatches(msg, m)[[1]] if (length(matches) < 2L) break full_match <- matches[1L]