On Tue, 20 Jun 2006 23:37:25 +0200, Eric Hodel <drbrain / segment7.net> wrote: > On Jun 20, 2006, at 1:53 PM, Dominik Bathon wrote: > >> Some things that RubyNode can do and ParseTree currently cannot: >> >> -Low level access: >> ParseTree only gives you the s-exps, with RubyNode you can get the >> flags field, the line number and the filename of the node. You can also >> get each the raw long value of each union if you really want, and so on. > > ParseTree supports line numbers and filenames of lines of the original > ruby code. Okay, I missed that ParseTree supports that through NODE_NEWLINE, but NODE_NEWLINE is no longer available in 1.9. > We lack getting the flags or the original value of the NODE, but we've > never needed these things. > >> -Access node trees of procs > > ParseTree can do this too, but with a little bit of hacking. I forgot > where we put it, but I believe this code is in ZenHacks. > > I believe we could also do this with some C code, but that's less fun > than our hack. > >> -Parse arbitrary strings of Ruby code to node trees without evaling >> them: >> ParseTree only allows evaling code and then only provides access to >> method node trees, with RubyNode you can just do: >> >> [...] >> >> This feature is actually quite simple and I think it should be added to >> ParseTree. > > We haven't seriously looked into making this work, we had more pressing > issues. >