SCM

SCM Repository

[inlinedocs] Diff of /pkg/inlinedocs/R/package.skeleton.dx.R
ViewVC logotype

Diff of /pkg/inlinedocs/R/package.skeleton.dx.R

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

revision 197, Fri Feb 18 14:09:37 2011 UTC revision 198, Fri Feb 18 14:17:08 2011 UTC
# Line 234  Line 234 
234      cat("\n", file = nmspFile, append = TRUE)      cat("\n", file = nmspFile, append = TRUE)
235      for (N in unique(names(docs))) {      for (N in unique(names(docs))) {
236          d <- docs[[N]]          d <- docs[[N]]
237          if (!is.null(d$s3method))          if (!is.null(d$.s3method))
238              cat('S3method("', d$s3method[1], '", "', d$s3method[2], '")\n',              cat('S3method("', d$.s3method[1], '", "', d$.s3method[2], '")\n',
239                  sep = "", file = nmspFile, append = TRUE)                  sep = "", file = nmspFile, append = TRUE)
240      }      }
241    }    }
# Line 385  Line 385 
385    ## Find and replace based on data in d    ## Find and replace based on data in d
386    txt <- paste(dlines,collapse="\n")    txt <- paste(dlines,collapse="\n")
387    for(torep in names(d)){    for(torep in names(d)){
388      if ( "s3method" == torep ){         # s3method is a flag handled later      if ( ".s3method" == torep ){         # .s3method is a flag handled later
389        next        next
390      }      }
391      cat(" ",torep,sep="")      cat(" ",torep,sep="")
# Line 427  Line 427 
427       utxt <- gsub("data[(]([^)]*)[)]","\\1",utxt)       utxt <- gsub("data[(]([^)]*)[)]","\\1",utxt)
428     }     }
429    
430    ## fix \method version if s3method    ## fix \method version if .s3method
431    if ( !is.null(d$s3method) ){    if ( !is.null(d$.s3method) ){
432      pat <- paste(d$s3method,collapse=".")      pat <- paste(d$.s3method,collapse=".")
433      rep <- paste("\\method{xx",d$s3method[1],"}{",d$s3method[2],"}",sep="")      rep <- paste("\\method{xx",d$.s3method[1],"}{",d$.s3method[2],"}",sep="")
434      utxt <- gsub(pat,rep,utxt,fixed=TRUE)      utxt <- gsub(pat,rep,utxt,fixed=TRUE)
435    
436      # PhG: there is the special case of generic<-.obj(x, ..., value) to rewrite      # PhG: there is the special case of generic<-.obj(x, ..., value) to rewrite
437      # \method{generic}{obj}(x, ...) <- value      # \method{generic}{obj}(x, ...) <- value
438      if (grepl("<-$", d$s3method[1])) {      if (grepl("<-$", d$.s3method[1])) {
439          # 1) replace {generic<-} by {generic}          # 1) replace {generic<-} by {generic}
440          utxt <- sub("<-[}]", "}", utxt)          utxt <- sub("<-[}]", "}", utxt)
441          # 2) replace ..., value) by ...) <- value          # 2) replace ..., value) by ...) <- value
# Line 463  Line 463 
463                 sep="")                 sep="")
464    ## delete empty sections to suppress warnings in R CMD check    ## delete empty sections to suppress warnings in R CMD check
465    txt <- gsub("\\\\[a-z]+[{]\\W*[}]","",txt)    txt <- gsub("\\\\[a-z]+[{]\\W*[}]","",txt)
466    if ( !is.null(d$s3method) ){    if ( !is.null(d$.s3method) ){
467      ## and now remove the xx inserted above to prevent \method{[[}{...} falling      ## and now remove the xx inserted above to prevent \method{[[}{...} falling
468      ## foul of the above replacement!      ## foul of the above replacement!
469      txt <- gsub("\\\\method{xx","\\method{",txt,fixed=TRUE)      txt <- gsub("\\\\method{xx","\\method{",txt,fixed=TRUE)

Legend:
Removed from v.197  
changed lines
  Added in v.198

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