SCM

SCM Repository

[inlinedocs] Diff of /pkg/inlinedocs/R/parsers.R
ViewVC logotype

Diff of /pkg/inlinedocs/R/parsers.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 336, Thu Apr 5 12:44:33 2012 UTC revision 376, Mon Jan 28 01:08:01 2013 UTC
# Line 38  Line 38 
38    ## Save the modification times of the Rd files    ## Save the modification times of the Rd files
39    old <- file.info(Rd.paths)$mtime    old <- file.info(Rd.paths)$mtime
40    
41      ## make sure there is at least 2 seconds elapsed, which is the
42      ## resolution for recording times on windows file systems.
43      Sys.sleep(4)
44    
45    ## However, it will NOT generate Rd for files specified in    ## However, it will NOT generate Rd for files specified in
46    ## do.not.generate, if they DO exist already.    ## do.not.generate, if they DO exist already.
47    package.skeleton.dx("silly",parsers)    package.skeleton.dx("silly",parsers)
# Line 53  Line 57 
57    setwd(owd)    setwd(owd)
58  })  })
59    
60    ### combine NULL objects.
61    combine.NULL<-function(x,y){
62        if (class(x) == "NULL"){
63            # print(paste("mm x=",x))
64            # print(paste("mm class(x)=",class(x)))
65            x=list("")
66        }
67        if (class(y) == "NULL"){
68            # print(paste("mm y=",y))
69            # print(paste("mm class(y)=",class(y)))
70            y=list("")
71        }
72        return(combine(x,y))
73    }
74    
75  ### combine lists or character strings  ### combine lists or character strings
76  combine <- function(x,y)UseMethod("combine")  combine <- function(x,y){
77        UseMethod("combine")
78    }
79    
80  ### combine character strings by pasting them together  ### combine character strings by pasting them together
81  combine.character <- function(x,y)  combine.character <- function(x,y)
# Line 741  Line 762 
762           )           )
763    
764  extract.file.parse <- function # File content analysis  extract.file.parse <- function # File content analysis
765  ### Using the base \code{\link{parse}} function, analyse the file to link  ### Using the base \code{parse} function, analyse the file to link
766  ### preceding "prefix" comments to each active chunk. Those comments form  ### preceding "prefix" comments to each active chunk. Those comments form
767  ### the default description for that chunk. The analysis also looks for  ### the default description for that chunk. The analysis also looks for
768  ### S4 class "setClass" calls and R.oo setConstructorS3 and setMethodS3  ### S4 class "setClass" calls and R.oo setConstructorS3 and setMethodS3
# Line 813  Line 834 
834        generic.name <- chars[2]        generic.name <- chars[2]
835        object.name <- paste(generic.name,chars[3],sep=".")        object.name <- paste(generic.name,chars[3],sep=".")
836        if ( is.null(res[[generic.name]]) ){        if ( is.null(res[[generic.name]]) ){
837          generic.desc <- paste("Generic method behind \\code{\\link{",object.name,"}}",sep="")          ## TDH 9 April 2012 Do NOT add \\link in generic.desc below,
838            ## since it causes problems on R CMD check.
839            ##* checking Rd cross-references ... WARNING
840            ##Error in find.package(package, lib.loc) :
841            ##  there is no package called ‘MASS’
842            ##Calls: <Anonymous> -> lapply -> FUN -> find.package
843    
844            generic.desc <-
845              paste("Generic method behind \\code{",object.name,"}",sep="")
846          res[[generic.name]] <- new("DocLink",          res[[generic.name]] <- new("DocLink",
847                                     name=generic.name,                                     name=generic.name,
848                                     created=expr.type,                                     created=expr.type,
# Line 847  Line 876 
876  ### in the form \code{setClass("classname",\dots)} are also located and  ### in the form \code{setClass("classname",\dots)} are also located and
877  ### scanned for inline comments.  ### scanned for inline comments.
878  (doc.link  (doc.link
879  ### DocLink object as created by \code{\link{extract.file.parse}}.  ### DocLink object as created by \code{extract.file.parse}.
880  ### Note that \code{source} statements are \emph{ignored} when scanning for  ### Note that \code{source} statements are \emph{ignored} when scanning for
881  ### class definitions.  ### class definitions.
882   ){   ){
# Line 939  Line 968 
968    if(verbose)cat("Applying parsers:\n")    if(verbose)cat("Applying parsers:\n")
969    for(i in seq_along(parsers)){    for(i in seq_along(parsers)){
970      N <- names(parsers[i])      N <- names(parsers[i])
971      if(verbose){      #mm if(verbose){
972        if(is.character(N) && N!=""){        if(is.character(N) && N!=""){
973          cat(N,"\n",sep="")          cat(" this is parser:",N,"\n",sep="")
974        }else cat('.\n')        }else cat('.\n')
975      }      #mm }
976      p <- parsers[[i]]      p <- parsers[[i]]
977      ## This is the argument list that each parser receives:      ## This is the argument list that each parser receives:
978      L <- p(code=code,objs=objs,docs=docs,env=e,...)      L <- p(code=code,objs=objs,docs=docs,env=e,...)
979        # print("mm point1")
980        #save(docs,L,file="/home/mm/SoilR/scripts/docs_L.RData")
981      #print(paste(L,"\n"))      #print(paste(L,"\n"))
982      #if(N=="exclude")browser()      #if(N=="exclude")browser()
983      docs <- combine(docs,L)      docs <- combine(docs,L) #mm
984    }    }
985    ## post-process to collapse all character vectors    ## post-process to collapse all character vectors
986    for(i in seq_along(docs)){    for(i in seq_along(docs)){

Legend:
Removed from v.336  
changed lines
  Added in v.376

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge