Skip to content
Prev 55262 / 63424 Next

Rd parser throws error for user macros invoked with empty argument

Thanks for looking into this, empty string is the natural solution indeed.

Georgi


-----Original Message-----
From: Tomas Kalibera [mailto:tomas.kalibera at gmail.com] 
Sent: 25 May 2018 10:05
To: Georgi Boshnakov; r-devel at r-project.org
Subject: Re: [Rd] Rd parser throws error for user macros invoked with empty argument

Thanks for the report and the examples - and they do not have to be that 
verbose, it is enough to just define and use a command, e.g.

cat("\\newcommand{\\mac1}{MAC1:#1}\\mac1{}", file=f)
rd <- tools::parse_Rd(f)

Whenever you get an error message like "Value of SET_STRING_ELT() must 
be a 'CHARSXP' not a 'NULL'", there is a bug (at least the error message 
should be relevant/informative).

I am testing a patch that will allow empty arguments to macros (they 
will expand to an empty string, like in LaTeX).

Best
Tomas
On 05/14/2018 11:23 PM, Georgi Boshnakov wrote: