[Parsetree] patch for op_asgn1

Ryan Davis ryand-ruby at zenspider.com
Sun Sep 10 00:32:26 PDT 2006


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



More information about the Parsetree mailing list