Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions R/shared_constants.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,7 @@ extract_glued_symbols <- function(expr, interpret_glue = TRUE) {

glued_symbols <- new.env(parent = emptyenv())
for (glue_call in glue_calls) {
# TODO(#2475): Drop tryCatch().
parsed_call <-
tryCatch(xml2lang(glue_call), error = unexpected_glue_parse_error, warning = unexpected_glue_parse_error)
parsed_call <- xml2lang(glue_call)
parsed_call[[".envir"]] <- glued_symbols
parsed_call[[".transformer"]] <- glue_symbol_extractor
# #1459: syntax errors in glue'd code are ignored with warning, rather than crashing lint
Expand All @@ -291,14 +289,6 @@ extract_glued_symbols <- function(expr, interpret_glue = TRUE) {
names(glued_symbols)
}

unexpected_glue_parse_error <- function(cond) {
# nocov start
cli_abort(c(
x = "Unexpected failure to parse glue call.",
i = "Please report: {conditionMessage(cond)}"
))
# nocov end
}
glue_parse_failure_warning <- function(cond) {
cli_warn(c(
x = "Evaluating glue expression while testing for local variable usage failed: {conditionMessage(cond)}",
Expand Down
Loading