On Wed, Sep 21, 2011 at 11:10 AM, Renaud Gaujoux <ren...@cbio.uct.ac.za> wrote:
> It was very straightforward indeed.
> Patching line 324 of roclet-rd.R with the following seems to do the trick:
>
> if (is.null(name)){
>    # get the location and filename from srcref
>    ll <- partitum$srcref$lloc
>    stop("Missing name in block ", basename(partitum$srcref$filename),
> ":lines ", ll[1], "-", ll[3])
> }
>
> More verbose error messages for other types of errors (e.g. related to wrong
> usage of roxygen flags) would still be nice to have as well, but this at
> least allows to pinpoint very problematic blocks.

It would be even better to pull that out into a separate function:

roxygen_stop <- function(msg, srcref) {
  ll <-srcref$lloc
  stop(msg, "\n", "In: ",  basename(srcref$filename),  ":lines ",
ll[1], "-", ll[3])
}

then replace all uses of stop (and similarly for warning).

A patch along those lines would be greatly appreciated!

> This brought me to another question (which might need a separate post
> though): it seems that union class names are not extracted (throws the
> error: Missing name).

You'll need to provide more details on that one.

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
_______________________________________________
Roxygen-devel mailing list
Roxygen-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel

Reply via email to