Skip to content

Commit

Permalink
Merged origin/main into upkeep-2023
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Mar 8, 2023
2 parents 78712ce + fac5b34 commit 28627fe
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Imports:
knitr,
methods,
pkgload (>= 1.0.2),
purrr (>= 0.3.3),
purrr (>= 1.0.0),
R6 (>= 2.1.2),
rlang (>= 1.0.6),
stringi,
Expand Down
2 changes: 1 addition & 1 deletion R/namespace.R
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ namespace_exports <- function(path) {
return(character())
}

parsed <- parse(path, keep.source = TRUE)
parsed <- as.list(parse(path, keep.source = TRUE))
is_import <- function(x) is_call(x, c("import", "importFrom", "importClassesFrom", "importMethodsFrom", "useDynLib"))
export_lines <- attr(parsed, "srcref")[!map_lgl(parsed, is_import)]
unlist(lapply(export_lines, as.character))
Expand Down
2 changes: 1 addition & 1 deletion R/object-from-call.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object_from_call <- function(call, env, block, file) {
parser_data(call, env, file)
}
} else if (is.call(call)) {
call <- call_standardise(call, env)
call <- call_match(call, eval(call[[1]], env))
name <- deparse(call[[1]])
switch(name,
"=" = ,
Expand Down
2 changes: 1 addition & 1 deletion R/rd-usage.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ usage_args <- function(args) {

text
}
map_chr(args, arg_to_text)
map_chr(as.list(args), arg_to_text)
}

args_string <- function(x, space = " ") {
Expand Down
7 changes: 5 additions & 2 deletions tests/testthat/_snaps/markdown-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
Condition
Warning:
[<text>:4] @description failed to evaluate inline markdown code
Caused by error in `map_chr()`:
i In index: 1.
Caused by error:
! Failed to parse the inline R code: 1 + (Reason: <text>:2:0: unexpected end of input
! Failed to parse the inline R code: `r 1 + `
Reason: <text>:2:0: unexpected end of input
1: 1 +
^)
^

# interleaving fences and inline code

Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/_snaps/object-r6.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
Code
extract_r6_data(C)
Condition
Error:
Error in `map_int()`:
i In index: 1.
i With name: meth1.
Caused by error:
! R6 class <foo> lacks source references.
i If you are using the `installed` load method in `DESCRIPTION`, then try re-installing the package with option '--with-keep.source', e.g. `install.packages(..., INSTALL_OPTS = "--with-keep.source")`.

4 changes: 3 additions & 1 deletion tests/testthat/_snaps/rd-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Code
roc_proc_text(rd_roclet(), block)
Condition
Error:
Error in `map_chr()`:
i In index: 1.
Caused by error:
! Can't find template "doesn't-exist"

0 comments on commit 28627fe

Please sign in to comment.