From: Eric Hodel Date: 2004-11-11T10:52:25+09:00 Subject: Re: [ANN] ParseTree 1.0.0 Released On Nov 10, 2004, at 5:36 PM, Lothar Scholz wrote: > Hello Ryan, > > RD> ParseTree version 1.0.0 has been released! > > RD> http://www.zenspider.com/ZSS/Products/ParseTree/ > > RD> ** DESCRIPTION: > > Thanks for the release. > > Can you tell me why the following nodes don't have a corresponding > element in the result tree ? Are they not used anymore in the ruby > interpreter ? > > case NODE_BLOCK_ARG: > case NODE_SELF: > case NODE_NIL: > case NODE_TRUE: > case NODE_FALSE: > case NODE_ZSUPER: > case NODE_BMETHOD: > case NODE_REDO: > case NODE_RETRY: > case NODE_COLON3: > case NODE_NTH_REF: > case NODE_BACK_REF: > case NODE_ZARRAY: > case NODE_XSTR: > case NODE_UNDEF: > case NODE_ALIAS: > case NODE_VALIAS: The comment just above explains most of it: // these are things we know we do not need to translate to C. The goals we originally had for ParseTree didn't need any of those nodes (even though true, nil, and false work ok) for what we were doing. We quickly realized how useful ParseTree could be beyond what we were using it for, so launched it as a separate project. If you run some code through show with the equivalents of those nodes, they simply end up as empty nodes. If you need those nodes, you could simply fill in the proper C code to extract them, then send us a patch. $ cat x.rb class X def foo ::X nil true false super [] self end end $ parse_tree_show x.rb ./x.rb:3: warning: useless use of :: in void context ./x.rb:4: warning: useless use of nil in void context ./x.rb:5: warning: useless use of true in void context ./x.rb:6: warning: useless use of false in void context [[:defn, "foo", [:scope, [:block, [:args], [:colon3], [:nil], [:true], [:false], [:zsuper], [:zarray], [:self]]]]]