[Parsetree] patch for op_asgn1

Topher Cyll christophercyll at gmail.com
Tue Sep 12 21:37:09 PDT 2006


Sure thing.  By the way, is there a good source of documentation for
the AST nodes?  The only one I could find seemed to be a book written
in Japanese...

-Toph

On 9/10/06, Ryan Davis <ryand-ruby at zenspider.com> wrote:
>
> Please make use of the bug tracker on rubyforge for these types of
> reports. And if you can, include a test.
>
> On Sep 8, 2006, at 5:54 PM, Topher Cyll wrote:
>
> > Hi,
> >
> > I noticed it's currently impossible to distinguish the op_asgn1 node
> > for the following two expressions:
> >
> > a['foo'] += 1
> > a['foo'] -= 1
> >
> > The following patch to parse_tree.rb (which I'm sending inline since
> > cut and paste probably makes more sense than patch) adds the operator
> > symbol to the sexp:
> >
> >    case NODE_OP_ASGN1:
> >      add_to_parse_tree(current, node->nd_recv, newlines, locals);
> >      add_to_parse_tree(current, node->nd_args->nd_next, newlines,
> > locals);
> > +    rb_ary_push(current, ID2SYM(node->nd_mid));
> >      add_to_parse_tree(current, node->nd_args->nd_head, newlines,
> > locals);
> >      break;
> >
> > What do you think?
> >
> > Topher
> > _______________________________________________
> > Parsetree mailing list
> > Parsetree at zenspider.com
> > http://www.zenspider.com/mailman/listinfo/parsetree
>
> _______________________________________________
> Parsetree mailing list
> Parsetree at zenspider.com
> http://www.zenspider.com/mailman/listinfo/parsetree
>


More information about the Parsetree mailing list