[Roxygen-commits] r28 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 3 07:24:10 CEST 2008


Author: pcd
Date: 2008-06-03 07:24:10 +0200 (Tue, 03 Jun 2008)
New Revision: 28

Modified:
   pkg/R/main.R
   pkg/R/parse.R
Log:
need srcrefs for prerefs; command line for parsand


Modified: pkg/R/main.R
===================================================================
--- pkg/R/main.R	2008-06-03 05:06:03 UTC (rev 27)
+++ pkg/R/main.R	2008-06-03 05:24:10 UTC (rev 28)
@@ -1,3 +1,10 @@
+source('list.R')
 source('parse.R')
 
-parse.file('example.R')
+FILE <- 'example.R'
+
+argv <- commandArgs(trailingOnly=T)
+argc <- length(argv)
+file <- ifelse(argc > 0, car(argv), FILE)
+
+parse.file(file)

Modified: pkg/R/parse.R
===================================================================
--- pkg/R/parse.R	2008-06-03 05:06:03 UTC (rev 27)
+++ pkg/R/parse.R	2008-06-03 05:24:10 UTC (rev 28)
@@ -9,7 +9,7 @@
        gsub('[[:space:]]+$', '', string))
 
 #' Comment blocks (possibly null) that precede a file's expressions.
-prerefs <- function(srcfile) {
+prerefs <- function(srcfile, srcrefs) {
   length.line <- function(lineno)
     nchar(getSrcLines(srcfile, lineno, lineno))
 
@@ -126,5 +126,5 @@
   srcfile <- srcfile(file)
   srcrefs <- attributes(parse(srcfile$filename,
                               srcfile=srcfile))$srcref
-  parse.refs(zip.list(prerefs(srcfile), srcrefs))
+  parse.refs(zip.list(prerefs(srcfile, srcrefs), srcrefs))
 }



More information about the Roxygen-commits mailing list