[Roxygen-commits] r175 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 24 01:10:48 CEST 2008


Author: pcd
Date: 2008-08-24 01:10:48 +0200 (Sun, 24 Aug 2008)
New Revision: 175

Modified:
   pkg/R/parse.R
Log:
arbitrary number of hashes before apostrophe


Modified: pkg/R/parse.R
===================================================================
--- pkg/R/parse.R	2008-08-12 09:55:54 UTC (rev 174)
+++ pkg/R/parse.R	2008-08-23 23:10:48 UTC (rev 175)
@@ -5,7 +5,7 @@
 roxygen()
 
 #' Sequence that distinguishes roxygen comment from normal comment.
-LINE.DELIMITER <- '#\''
+LINE.DELIMITER <- '#+\''
 
 #' Symbol that delimits tags.
 TAG.DELIMITER <- '@'
@@ -271,16 +271,14 @@
                                       car(ref),
                                       caddr(ref)))
   delimited.lines <-
-    Filter(function(line) grep(sprintf('^%s', LINE.DELIMITER), line), lines)
-  ## Trim LINE.DELIMITER + one space (benign for spaceless delimeters).
-  trimmed.lines <-
-    Map(function(line) substr(line, nchar(LINE.DELIMITER) + 2, nchar(line)),
-        delimited.lines)
+    Filter(function(line) grep(LINE.DELIMITER, line), lines)
+  ## Take next word after delimiter.
+  trimmed.lines <- Map(strcdr, delimited.lines)
   joined.lines <- do.call(paste, c(trimmed.lines, sep='\n'))
   if (is.nil(joined.lines))
     nil
   else {
-    ## Thanks to Fegis on #regex at Freenode for the
+    ## Thanks to Fegis at #regex on Freenode for the
     ## lookahead/lookbehind hack; as he notes, however, "it's not
     ## proper escaping though... it will not split a@@@b."
     elements <- car(strsplit(joined.lines,



More information about the Roxygen-commits mailing list