From: Ryan Davis Date: 2008-01-04T05:10:16+09:00 Subject: Re: parse tree? On Jan 3, 2008, at 06:46 , Giles Bowkett wrote: >>> Sorry, that was a dumb question, PT gives you sexps, not Ruby, you'd >>> need Ruby2Ruby for that, and even then it might not work. >> >> why not? > > As far as I can tell you get the whole shebang back, and I just need > particular expressions. > >> pt = ParseTree.new.parse_tree_for_string("1+2") > => [[:call, [:lit, 1], :+, [:array, [:lit, 2]]]] > >> Ruby2Ruby.new.process(pt.first) > => "(1 + 2)" does that help?