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 356, Mon Apr 9 15:39:09 2012 UTC revision 389, Tue Sep 3 04:33:09 2013 UTC
# Line 57  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 491  Line 508 
508        ## Look for a generic function (known by the system or defined        ## Look for a generic function (known by the system or defined
509        ## in the package) that matches that part of the function name        ## in the package) that matches that part of the function name
510        generic <- paste(parts[1:i], collapse = ".")        generic <- paste(parts[1:i], collapse = ".")
511        if (any(generic %in% utils:::getKnownS3generics()) ||        if (any(generic %in% getKnownS3generics()) ||
512            utils:::findGeneric(generic, env) != "") {            findGeneric(generic, env) != "") {
513          object <- paste(parts[(i + 1):l], collapse = ".")          object <- paste(parts[(i + 1):l], collapse = ".")
514          ##details<< Assumes that the first name which matches any known          ##details<< Assumes that the first name which matches any known
515          ## generics is the target generic function, so if both x and x.y          ## generics is the target generic function, so if both x and x.y
# Line 806  Line 823 
823                                  parent=parent,                                  parent=parent,
824                                  code=paste(chunks[[k]],sep=""),                                  code=paste(chunks[[k]],sep=""),
825                                  description=default.description)                                  description=default.description)
826      } else if ( expr.type == "setMethodS3" ){      } else if ( expr.type == "setMethodS3" || expr.type ==  "R.methodsS3::setMethodS3"){
827        ##details<< The \code{setMethodS3} calls introduce additional        ##details<< The \code{setMethodS3} calls introduce additional
828        ## complexity: they will define an additional S3 generic (which        ## complexity: they will define an additional S3 generic (which
829        ## needs documentation to avoid warnings at package build time)        ## needs documentation to avoid warnings at package build time)
# Line 951  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.356  
changed lines
  Added in v.389

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