Skip to content

Commit

Permalink
remove 'typetracer' calls from call_env data for #14
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jun 21, 2023
1 parent 5da1437 commit 5bb87bb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: typetracer
Title: Trace Function Parameter Types
Version: 0.1.1.013
Version: 0.1.1.014
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
7 changes: 5 additions & 2 deletions R/tracer-define.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ typetracer_header <- function () {
if (length (index) > 0L) {
call_envs$namespace [index] <- trace_dat$scope [index]
}
call_envs <-
call_envs [which (!call_envs$name == typetracer_env$fn_name), ]
call_envs <- call_envs [which (call_envs$namespace != "typetracer"), ]
if (nrow (call_envs) > 0L) {
# assume first branch of trace_back is desired env
call_envs <- call_envs [1, ]
}

list (
par = p,
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codeRepository": "https://github.com/mpadge/typetracer",
"issueTracker": "https://github.com/mpadge/typetracer/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.1.1.013",
"version": "0.1.1.014",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/_snaps/trace-fns.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@
if (length(index) > 0L) {
call_envs$namespace[index] <- trace_dat$scope[index]
}
call_envs <- call_envs[which(!call_envs$name == typetracer_env$fn_name),
call_envs <- call_envs[which(call_envs$namespace != "typetracer"),
]
if (nrow(call_envs) > 0L) {
call_envs <- call_envs[1, ]
}
list(par = p, class = class(res), typeof = typeof(res),
storage_mode = storage.mode(res), mode = mode(res),
length = length(res), par_uneval = s, par_eval = res,
Expand Down

0 comments on commit 5bb87bb

Please sign in to comment.