I don't have many concerns with us deviating from Ruby a bit here and there. However if we are going to add our own "special" nodes for such things we ought to make them traversable by a visitor, so they don't require custom code for handling.

It seems fair to store this information in the AST rather than putting it external. Is there any known reason not to?

On 7/10/06, Thomas E Enebo <[EMAIL PROTECTED]> wrote:
  This is JRuby expanding past Ruby's boundaries.  Someone needed this
information for RDT (or something like this) and in our parser we used
Ruby's way.  Which was just to maintain an actual arg count (arity) and
not store information about the actual arguments.

  This is from memory, but the reason Ruby does not properly build up
the args here is because they store this info outside the AST when they
first parse it (as we must do).

  The question I am wondering is what we do about this?  We could 'fix'
the parser to only maintain this info in one place and deviate from
Ruby's way.  I am not sure how much work this is, but it will make it
possible to write a ruby in ruby parser if we make this change.

-Tom

On Sun, 09 Jul 2006, Charles O Nutter defenestrated me:
>
>    While working on an AST pretty-printer, I came across the following
>    nugget in the parser:
>    case 446:
>                        // line 1844 "DefaultRubyParser.y"
>      {
>                        yyVal = new
>    ListNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition());
>                        ((ListNode) yyVal).add(new
>    ArgumentNode(((ISourcePositionHolder)yyVals[0+yyTop]).getPosition(),
>    (String) ((Token)yyVals[0+yyTop]).getValue()));
>                    }
>      break;
>    As far as I can tell there's no reason we should ever be instantiating
>    a ListNode, since ListNode can't be evaluated itself. It's also
>    creating ArgumentNode, which can't be evaluated either. What gives? I
>    had to modify the code in the pretty printer to work around this and
>    manually iterate over the list elements, pulling a name out from each.
>    --
>    Charles Oliver Nutter @ [1]headius.blogspot.com
>    JRuby Developer @ [2]www.jruby.org
>    Application Architect @ [3]www.ventera.com
>
> References
>
>    1. http://headius.blogspot.com/
>    2. http://www.jruby.org/
>    3. http://www.ventera.com/

>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

> _______________________________________________
> Jruby-devel mailing list
> Jruby-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jruby-devel


--
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel



--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ www.jruby.org
Application Architect @ www.ventera.com
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to