From 046ccf4b96d046340c243eda95e46fe7eb00b2e3 Mon Sep 17 00:00:00 2001 From: hornik Date: Sat, 22 Feb 2025 14:53:46 +0000 Subject: [PATCH] Tweaks. git-svn-id: https://svn.r-project.org/R/trunk@87793 00db46b3-68df-0310-9c12-caf00c1e9a41 --- src/library/tools/R/Rd.R | 10 ++++++---- src/library/tools/R/utils.R | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/library/tools/R/Rd.R b/src/library/tools/R/Rd.R index 357058c53b..362677968b 100644 --- a/src/library/tools/R/Rd.R +++ b/src/library/tools/R/Rd.R @@ -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 @@ -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"). ## ## Remove eventually. @@ -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"))], diff --git a/src/library/tools/R/utils.R b/src/library/tools/R/utils.R index e17f3f6f48..9eea4eefbb 100644 --- a/src/library/tools/R/utils.R +++ b/src/library/tools/R/utils.R @@ -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") &&