[Rd] Mapping parse tree elements to tokens

Jim Hester james.f.hester at gmail.com
Wed Jul 29 18:13:57 CEST 2015


I would like to map the parsed tokens obtained from utils::getParseData()
to the parse tree and elements obtained by base::parse().

It looks like back when this code was in the parser package the parse()
function annotated the elements in the tree with their id, which would
allow you to perform this mapping.  However when the code was included in R
this functionality was removed.

?getParseData states
  The ‘id’ values are not attached to the elements of the parse
          tree, they are only retained in the table returned by
          ‘getParseData’.

Is there another way you can map between the getParseData() tokens and
elements of the parse tree that makes this additional annotation
unnecessary?  Or is this simply not possible?

	[[alternative HTML version deleted]]



More information about the R-devel mailing list