Skip to content

Commit

Permalink
tweak c84551
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87435 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
smeyer committed Dec 10, 2024
1 parent 5e4b78c commit 71a2e96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/library/tools/R/RdConv2.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ processRdChunk <- function(code, stage, options, env, macros)
res <- character(0)

tags <- RdTags(code)
if (length(bad <- setdiff(tags, c("RCODE", "COMMENT"))))
if (length(bad <- setdiff(tags, c("RCODE", "TEXT", "COMMENT"))))
## also USERMACROs are currently not supported inside \Sexpr{}
warnRd(code, Rdfile, "\\Sexpr expects R code; found ",
paste0(sQuote(bad), collapse = ", "))
Expand Down Expand Up @@ -379,6 +379,7 @@ processRdIfdefs <- function(blocks, defines)
tagged(list(
tagged(paste(tag, target, "not active"),
"COMMENT", attr(block, "srcref")),
## converters expect (and drop) newline from COMMENT
tagged("\n",
"TEXT", attr(block, "srcref"))
), "#expanded")
Expand Down
3 changes: 2 additions & 1 deletion tests/reg-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ stopifnot(exprs = {
any(grepl("See Also:", helptxt, fixed = TRUE)) == (.Platform$OS.type == "windows")

## post-build macros can contain conditional defines
tools::Rd2txt(installedRdDB[["nestedDefinesOK.Rd"]])
tools::Rd2txt(installedRdDB[["nestedDefinesOK.Rd"]],
options = list(underline_titles = FALSE))
deparsedLines <- as.character(installedRdDB[["nestedDefinesOK.Rd"]])
stopifnot(("unix" %in% deparsedLines) == (.Platform$OS.type == "unix"),
("windows" %in% deparsedLines) == (.Platform$OS.type == "windows"))
Expand Down

0 comments on commit 71a2e96

Please sign in to comment.