Skip to content

Commit

Permalink
stop importing xfun::isFALSE() and define isFALSE() only for R < 3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Dec 13, 2022
1 parent f440712 commit ccb07c4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.41.1
Version: 1.41.2
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Abhraneel", "Sarma", role = "ctb"),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ import(utils)
importFrom(xfun,attr)
importFrom(xfun,file_ext)
importFrom(xfun,file_string)
importFrom(xfun,isFALSE)
importFrom(xfun,is_R_CMD_check)
importFrom(xfun,is_abs_path)
importFrom(xfun,is_windows)
Expand Down
2 changes: 1 addition & 1 deletion R/block.R
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ purge_cache = function(options) {

cache_globals = function(option, code) {
if (is.character(option)) option else {
(if (xfun::isFALSE(option)) find_symbols else find_globals)(code)
(if (isFALSE(option)) find_symbols else find_globals)(code)
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' \code{knit} + \code{R} (while \code{Sweave} = \code{S} + \code{weave}).
#' @references Full documentation and demos: \url{https://yihui.org/knitr/};
#' FAQ's: \url{https://yihui.org/knitr/faq/}
#' @importFrom xfun attr file_ext isFALSE is_windows loadable parse_only
#' @importFrom xfun attr file_ext is_windows loadable parse_only
#' sans_ext try_silent with_ext read_utf8 write_utf8 file_string
#' is_R_CMD_check is_abs_path
NULL
Expand Down
3 changes: 3 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ comment_to_var = function(x, varname, pattern, envir) {
FALSE
}

# TODO: remove this when we don't support R < 3.5.0
if (getRversion() < '3.5.0') isFALSE = function(x) identical(x, FALSE)

is_blank = function(x) {
if (length(x)) all(grepl('^\\s*$', x)) else TRUE
}
Expand Down

0 comments on commit ccb07c4

Please sign in to comment.