Skip to content

Commit

Permalink
also have to apply nse to list items #19 for lists in ...
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jun 23, 2023
1 parent 30cf7c6 commit a27dcc0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/tracer-define.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ typetracer_header <- function () {
utils::getFromNamespace ("trace_one_list", "typetracer")
typetracer_env$get_trace_lists_param <-
utils::getFromNamespace ("get_trace_lists_param", "typetracer")

typetracer_env$data <- lapply (typetracer_env$par_names, function (p) {
dat_i <- typetracer_env$trace_one_param (typetracer_env, p, fn_env)
trace_lists <- typetracer_env$get_trace_lists_param ()
Expand Down Expand Up @@ -182,6 +183,15 @@ trace_one_list <- function (typetracer_env, p, fn_env) {
get (p, envir = fn_env, inherits = FALSE),
error = function (e) NULL
)

# non-standard evaluation, which is also necessary for lists passed as
# `...`:
if (is.null (res)) {
res <- tryCatch (
eval (typetracer_env$pars [[p]], envir = fn_env),
error = function (e) NULL
)
}
if (is.null (res)) {
return (res)
}
Expand Down

0 comments on commit a27dcc0

Please sign in to comment.