Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87793 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Feb 22, 2025
1 parent 170ebb7 commit 046ccf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/library/tools/R/Rd.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File src/library/tools/R/Rd.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2024 The R Core Team
# Copyright (C) 1995-2025 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -733,8 +733,9 @@ function(x)
if(!length(x)) return(character())

## Need to remove everything inside \dontrun (and drop comments),
## and "undefine" \dontshow and \testonly (which is achieved by
## changing the Rd tag to "Rd").
## and "undefine"
## \dontdiff \dontshow \donttest \testonly
## (which is achieved by changing the Rd tag to "Rd").

## <FIXME>
## Remove eventually.
Expand All @@ -743,7 +744,8 @@ function(x)

recurse <- function(e) {
if(!is.null(tag <- attr(e, "Rd_tag"))
&& tag %in% c("\\dontshow", "\\testonly"))
&& tag %in% c("\\dontdiff", "\\dontshow", "\\donttest",
"\\testonly"))
attr(e, "Rd_tag") <- "Rd"
if(is.list(e)) {
structure(lapply(e[is.na(match(RdTags(e), "\\dontrun"))],
Expand Down
2 changes: 1 addition & 1 deletion src/library/tools/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ function(ifile, ofile)
.parse_code_file <-
function(file, encoding = NA, keep.source = getOption("keep.source"))
{
if(!file.size(file)) return()
if(!file.exists(file) || !file.size(file)) return()
suppressWarnings({
if(!is.na(encoding) &&
(encoding != "unknown") &&
Expand Down

0 comments on commit 046ccf4

Please sign in to comment.