Skip to content
Prev 31994 / 63424 Next

Why does the lexical analyzer drop comments ?

On 22/03/2009 4:50 PM, Romain Francois wrote:
Currently srcrefs are only attached to whole statements.  Since your 
source only included one or two statements, you only get one or two 
srcrefs.  It would not be hard to attach a srcref to every 
subexpression; there hasn't been a need for that before, so I didn't do 
it just for the sake of efficiency.

However, it might make sense for you to have your own parser, based on 
the grammar in R's parser, but handling white space differently. 
Certainly it would make sense to do that before making changes to the 
base R one.  The whole source is in src/main/gram.y; if you're not 
familiar with Bison, I can give you a hand.

Duncan Murdoch