Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Jun 30, 2024
1 parent 95a8240 commit 7d1a59c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
13 changes: 11 additions & 2 deletions R/construction_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,21 @@ construct_model.survey.design <- function(data, formula, method, method.args = l
)
}

.as_list_of_exprs <- function(x) {
.as_list_of_exprs <- function(x, arg_name = "method.args") {
x_enexpr <- enexpr(x)
if (is_call_simple(x_enexpr)) {
return(call_args(x_enexpr))
}

if (tryCatch(inherits(x, "list"), error = \(x) FALSE)) {
return(x)
}
call_args(x_enexpr)

cli::cli_abort(
c("There was an error processing the {.arg {argname}} argument.",
i = "Expecting a simple call. See {.help rlang::is_call_simple} for details."),
call = get_cli_abort_call()
)
}

#' @rdname construction_helpers
Expand Down

0 comments on commit 7d1a59c

Please sign in to comment.