Skip to content

Commit

Permalink
version 0.2-16
Browse files Browse the repository at this point in the history
  • Loading branch information
ltierney authored and cran-robot committed Dec 24, 2018
1 parent 9bac1da commit e10d13c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,5 +1,5 @@
Package: codetools
Version: 0.2-15
Version: 0.2-16
Priority: recommended
Author: Luke Tierney <luke-tierney@uiowa.edu>
Description: Code analysis tools for R.
Expand All @@ -8,6 +8,6 @@ Depends: R (>= 2.1)
Maintainer: Luke Tierney <luke-tierney@uiowa.edu>
License: GPL
NeedsCompilation: no
Packaged: 2016-10-05 12:32:32 UTC; luke
Packaged: 2018-12-22 14:48:17 UTC; luke
Repository: CRAN
Date/Publication: 2016-10-05 16:36:47
Date/Publication: 2018-12-24 12:40:05 UTC
8 changes: 4 additions & 4 deletions MD5
@@ -1,8 +1,8 @@
dfa8498b455155a5b2fc59c318c55f3f *DESCRIPTION
e48906bf15c7ce12219499d2ef9a442a *DESCRIPTION
d7d4587719d6cbb3083123501ec23dd3 *NAMESPACE
e1a0def8009a2bc24365d7c1d0e9111d *R/codetools.R
898067d87a5ce3373b6a5b83c150746c *R/codetools.R
2af77179b93b37abb2717ba0dacd60a3 *man/checkUsage.Rd
215ca204e6c7206111e585206cee095c *man/codetools.Rd
31aabac379a9264e4ce819755b95b601 *man/findGlobals.Rd
722f473fac8f4c14d9fc199953daab44 *man/codetools.Rd
29fbed23cf38b444df2df0ce0389946b *man/findGlobals.Rd
7915e973bb95db1197db9152d339f2c8 *man/showTree.Rd
838118aa4116e6b2d66e393dae8e4073 *tests/tests.R
12 changes: 7 additions & 5 deletions R/codetools.R
Expand Up @@ -376,8 +376,10 @@ makeUsageCollector <- function(fun, ..., name = NULL,
finishCollectLocals = doNothing,
warn = warning0,
signal = signalUsageIssue) {
if (typeof(fun) != "closure")
stop("only works for closures")
if (typeof(fun) == "closure")
env <- environment(fun)
else
env <- .GlobalEnv
makeCodeWalker(..., name = name,
enterLocal = enterLocal,
enterGlobal = enterGlobal,
Expand All @@ -389,8 +391,8 @@ makeUsageCollector <- function(fun, ..., name = NULL,
leaf = collectUsageLeaf,
call = collectUsageCall,
handler = getCollectUsageHandler,
globalenv = environment(fun),
env = environment(fun),
globalenv = env,
env = env,
name = NULL,
srcfile = NULL,
frow = NULL,
Expand Down Expand Up @@ -764,7 +766,7 @@ addCollectUsageHandler("if", "base", function(e, w) {
})

##
## Finding globa variables
## Finding global variables
##

findGlobals <- function(fun, merge = TRUE) {
Expand Down
2 changes: 1 addition & 1 deletion man/codetools.Rd
Expand Up @@ -61,7 +61,7 @@ walkCode(e, w = makeCodeWalker())
}
\description{
These functions provide some tools for analysing R code. Mainly
indented to support the other tools in this package and byte code
intended to support the other tools in this package and byte code
compilation.
}
\author{Luke Tierney}
Expand Down
5 changes: 3 additions & 2 deletions man/findGlobals.Rd
Expand Up @@ -5,12 +5,13 @@ findGlobals(fun, merge = TRUE)
}
\alias{findGlobals}
\arguments{
\item{fun}{closure.}
\item{fun}{function object; usually a closure.}
\item{merge}{logical}
}
\value{
Character vector if \code{merge} is true; otherwise, a list with
\code{functions} and \code{variables} components.
\code{functions} and \code{variables} character vector components.
Character vectors are of length zero For non-closures.
}
\description{
Finds global functions and variables used by a closure.
Expand Down

0 comments on commit e10d13c

Please sign in to comment.