From: Dominik Bathon Date: 2006-09-25T07:36:21+09:00 Subject: Re: [ANN] ParseTree 1.5.0 Released On Sun, 24 Sep 2006 22:02:25 +0200, Ryan Davis wrote: > ParseTree version 1.5.0 has been released! [snip] > ** FEATURES/PROBLEMS: > > + Uses RubyInline, so it just drops in. There seems to be a problem with RubyInline's strip_comments(). I'm not sure what the exact problem is, but it converts case NODE_LAMBDA: puts("no worky in 1.9 yet"); break; #{if_version :<, "1.9", "#endif"} // Nodes we found but have yet to decypher // I think these are all runtime only... not positive but... case NODE_MEMO: // enum.c zip case NODE_CREF: to case NODE_LAMBDA: puts("no worky in 1.9 yet"); break; #endif case NODE_MEMO: case NODE_CREF: Which obviously won't compile. (Tested on ruby 1.8.4 (2005-12-24) [i686-linux] and ruby 1.8.5 (2006-08-25) [i686-linux], RubyInline-3.6.0, everything installed using gems) [snip] > Changes: > > + 5 minor enhancements: > Added parse_tree_audit. > Added reporting of unsupported nodes that have processors. > YAY! class method support! generated as :"self.blah" > Add parse_tree_for_string. You made a mistake when copying the code from RubyNode: You always have to set ruby_eval_tree_begin to 0 (in 1.8), otherwise the code in BEGIN blocks will be executed the next time eval is called (which is immediatly in irb): $ ruby require "parse_tree" p ParseTree.new.parse_tree_for_string("BEGIN { puts 'evil' }; puts 'hello'") puts "before eval" p eval("'eval'") ^D [[:fcall, :puts, [:array, [:str, "hello"]]]] before eval evil "eval" > Converted Rakefile+gemspec to Hoe-based Rakefile. > + 6 bug fixes: > Did some preliminary work on 1.9 compatibility. > Fixed tests for some changes/clarifications. > Fixed resbody: should have nil exceptions list when no exception > rescued. > Fixed op_asgn1 and op_asgn2. > Fixed incompatibility with new inline changes. > Fixed VALUE decl in parse_tree.rb There have been changes to NODE_ALIAS and NODE_VALIAS in 1.8.5: $ irb -r parse_tree >> ParseTree.new.parse_tree_for_string("class A; alias a b; end") /home/dba/i/ruby-1.8.5/lib/ruby/1.8/irb.rb:298: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i686-linux] $ ruby -ve 'require "parse_tree"; p ParseTree.new.parse_tree_for_string("class A; alias $a $b; end")' ruby 1.8.4 (2005-12-24) [i686-linux] [[:class, :A, [:scope, [:valias, :$b, :$a]]]] $ ruby -ve 'require "parse_tree"; p ParseTree.new.parse_tree_for_string("class A; alias $a $b; end")' ruby 1.8.5 (2006-08-25) [i686-linux] [[:class, :A, [:scope, [:valias, :$a, :$b]]]] Dominik