[Roxygen-commits] r38 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 18 13:20:41 CEST 2008


Author: pcd
Date: 2008-06-18 13:20:40 +0200 (Wed, 18 Jun 2008)
New Revision: 38

Modified:
   pkg/R/parse.R
Log:
fix name.description; class keyword for S3 classes; togglers for listObject, etc.


Modified: pkg/R/parse.R
===================================================================
--- pkg/R/parse.R	2008-06-18 11:08:14 UTC (rev 37)
+++ pkg/R/parse.R	2008-06-18 11:20:40 UTC (rev 38)
@@ -85,18 +85,33 @@
 
 parse.importMethodsFrom <- Curry(parse.value, key='importMethodsFrom')
 
-parse.name.description <- function(key, name, ...)
-  ifelse(any(is.na(name),
-             is.empty(...)),
-         parse.error(key, 'requires a name and description'),
-         as.list(structure(list(list(name=name,
-                                     description=args.to.string(...))),
-                           names=key)))
+parse.name.description <- function(key, name, ...) {
+  if (any(is.na(name),
+          is.empty(...)))
+    parse.error(key, 'requires a name and description')
+  else
+    as.list(structure(list(list(name=name,
+                                description=args.to.string(...))),
+                      names=key))
+}
 
 parse.slot <- Curry(parse.name.description, key='slot')
 
 parse.param <- Curry(parse.name.description, key='param')
 
+## For S3 classes; single name only, and glean description from top
+## line of block?
+parse.class <- Curry(parse.name.description, key='class')
+
+parse.toggle <- function(key, ...)
+  as.list(structure(T, names=key))
+
+parse.listObject <- Curry(parse.toggle, key='listObject')
+
+parse.attributeObject <- Curry(parse.toggle, key='attributeObject')
+
+parse.environmentObject <- Curry(parse.toggle, key='environmentObject')
+
 ## srcref parsers
 
 parse.srcref <- function(...) nil



More information about the Roxygen-commits mailing list