[Rubygrammar-grammarians] Ruby Grammar Project

MenTaLguY mental at rydia.net
Fri Nov 25 23:17:08 EST 2005


On Sat, 2005-11-26 at 03:36 +0100, Mauricio Fernandez wrote:
> はじめまして、Fernandezと申します。
> On Fri, Nov 25, 2005 at 07:44:57PM -0500, MenTaLguY wrote:
> [reordered for clarity of exposition]
> > I am not sure that 'blah = zort' is parsed differently in these cases,
> > however; that subtree may look the same in the AST and simply get
> > interpreted differently.
> 
> IIRC they result in
> 
> >  def foo
>     zort = 3 # assign to variable         
>       => NODE_LASGN(ID:zort, INT2FIX(3), ...)
> >    blah = zort # assign to variable from variable  
>       => NODE_LASGN(ID:blah, NODE_LVAR(zort), ...)
> >  end

Ah, excellent.  Thanks.  So once the variable is introduced into the
scope, the AST generated for its bare name is in fact different.

What's the NODE_LASGN() notation from, by the way?

-mental
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051125/bdb95923/attachment-0001.bin


More information about the Rubygrammar-grammarians mailing list