From mwtoews at sfu.ca  Sun Oct 22 00:36:43 2006
From: mwtoews at sfu.ca (Michael Toews)
Date: Sat, 21 Oct 2006 15:36:43 -0700
Subject: [Rd] parse/INSTALL feature request(s)
In-Reply-To: <971536df0610202011u25f8ccfnba45dc9cc07f39d1@mail.gmail.com>
References: <45396A81.8080808@sfu.ca> <45398188.4000709@stats.uwo.ca>
	<971536df0610202011u25f8ccfnba45dc9cc07f39d1@mail.gmail.com>
Message-ID: <453AA0FB.9080502@sfu.ca>

> What would be possible is to do like other preprocessors do, and put
> comments into the source file to indicate the origin of each line:  then
> the parser could tell you the location in the original file, which would
> be a lot more useful.

I think what you are referring to is already nicely implemented (in 
R/src/main/source.c lines 89 to 97), and the errors are correctly shown 
in my example as lines 1222 to 1223. However, these line numbers are 
irrelevant to the original files, as they been concatenated into one 
large file (I think on line 765 of R/src/scripts/INSTALL.in ). This 
single file is loaded into an R environment (on line 790 of INSTALL.in), 
which is also the region where my original error from 'R CMD INSTALL' 
was thrown. The loading is done by the 'tools:::makeLazyLoading' 
function, which loads in the single R-source file into a fresh 
environment for the package.

I'm unsure of why a single R source file is needed in INSTALL (which 
limits the ability to show any offending file names and their line 
numbers). The functions in R/src/library/tools/R/makeLazyLoad.R could 
perhaps be made a bit more versatile to individually read the R source 
files for a package using a 'pattern="\.R$"', and throw an error from 
'sys.source' displaying the file name, and other error messages from 
'parse'. This is simply a feature-request suggestion, but as Gabor 
advised, I should really develop my functions file-by-file.
+mt




[Rd] parse/INSTALL feature request(s)
Michael Toews