On Wed, Apr 20, 2005 at 09:38:28AM -0700, Larry Wall wrote: > As someone who is currently trying to write a perfect p5-to-p5 [sic] > translator, you have to somehow remember the parens (and whitespace > (and comments (and constant-folded subtrees))) to have a complete AST > representation of the original text. Or maybe it should be called > a CST instead of an AST in that case...
I see. Do you think preserving the /span/ (i.e. the character offset ranges) of each AST element is enough to do that? That effectively means each node points to a substring inside the original source string. That way, p6-to-p6 translators in the future can, at worst, trigger a reparse under the appropriate subrules level, and obtain the information we optimized away. Thanks, /Autrijus/
Description: PGP signature