SCM Repository

[inlinedocs] View of /pkg/inlinedocs/inst/testfiles/alternate.R
ViewVC logotype

View of /pkg/inlinedocs/inst/testfiles/alternate.R

Parent Directory Parent Directory | Revision Log Revision Log

Revision 307 - (download) (annotate)
Fri Oct 21 11:37:19 2011 UTC (7 years, 6 months ago) by tdhock
File size: 935 byte(s)
test errors reported more clearly
simple <- function(src,...){#title a simple Parser Function
  noquotes <- gsub("([\"'`]).*\\1","",src)
  comments <- grep("#",noquotes,value=TRUE)
  pat <- "[^#]*#([^ ]*) (.*)"
  tags <- gsub(pat,"\\1",comments)
  docs <- as.list(gsub(pat,"\\2",comments))
  names(docs) <- tags
  docs[tags!=""]#value all the tags with a single pound sign

.parsers <- list(simple=forfun(simple))

testfun <- function(x,y,z){#item{x} the first arg
  a <- (x+y)*z # just a regular comment
  a #value the sum of the first two times the third
  #description a useless formula

.result <- list(testfun=list(`item{x}`="the first arg",
                  value="the sum of the first two times the third",
                  description="a useless formula"),
                simple=list(title="a simple Parser Function",
                  value="all the tags with a single pound sign"))

.dontcheck <- TRUE # because of use of forfun here
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge