Skip to content

Commit 046ccf4

Browse files
author
hornik
committed
Tweaks.
git-svn-id: https://svn.r-project.org/R/trunk@87793 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 170ebb7 commit 046ccf4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/library/tools/R/Rd.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/tools/R/Rd.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2024 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -733,8 +733,9 @@ function(x)
733733
if(!length(x)) return(character())
734734

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

739740
## <FIXME>
740741
## Remove eventually.
@@ -743,7 +744,8 @@ function(x)
743744

744745
recurse <- function(e) {
745746
if(!is.null(tag <- attr(e, "Rd_tag"))
746-
&& tag %in% c("\\dontshow", "\\testonly"))
747+
&& tag %in% c("\\dontdiff", "\\dontshow", "\\donttest",
748+
"\\testonly"))
747749
attr(e, "Rd_tag") <- "Rd"
748750
if(is.list(e)) {
749751
structure(lapply(e[is.na(match(RdTags(e), "\\dontrun"))],

src/library/tools/R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ function(ifile, ofile)
22002200
.parse_code_file <-
22012201
function(file, encoding = NA, keep.source = getOption("keep.source"))
22022202
{
2203-
if(!file.size(file)) return()
2203+
if(!file.exists(file) || !file.size(file)) return()
22042204
suppressWarnings({
22052205
if(!is.na(encoding) &&
22062206
(encoding != "unknown") &&

0 commit comments

Comments
 (0)