On Thu, 27 Apr 2006, Mirko Stocker defenestrated me:
>
> Hi Tom
> 
> On Tuesday 25 April 2006 16:46, Thomas E Enebo wrote:
> > If you understand this code you can create some simple
> > unit tests to add to testPositions and I can likely figure those out (or
> > help you figure them out).
> 
> I studied the code and wrote a test for the ClassVarDeclNode, InstAsgnNode and
> LocalAsgnNode which fail as expected. To the fixing, should I try to do it or 
> are you going to take a look at it?

  Take a shot at it.  I have put the parser processing code at:
http://www.tc.umn.edu/~enebo/jruby/parser.tar.gz

  Compile Jay for your platform (I believe I have the windows binaries
there).  Install it somewhere.  Update 'update' to have the correct paths
to your jruby source.  If you are windows you will need cygwin.  Once this is 
done, you just need to edit the grammar file (and possibly ParserSupport).

  The general gist is usually finding where the node in question is
created and the changing the position argument to be correct.  For things
like these assignment nodes it will likely involve doing a support.union
on first and last args in the current production (different nodes can
serve as examples).

  The two places to update are DefaultRubyParser.y and ParserSupport.java.
If you change the DefaultRubyParser.y you need to run 'update' to regenerate
DefaultRubyParser.java (it will also make YyTables.java but will not
be any different in this case).

  You can email me with any questions or send me your IM info too if you
want.  It would be great to get another set of hands on this since I am
pretty busy. 

-Tom

> 
> list = [
> nil,
> ['ClassNode', 0, 6, 0, 81],
> ['Colon2Node', 0, 0, 6, 9],
> ['ScopeNode', 1, 5, 20, 77],
> ['BlockNode', 1, 5, 20, 77],
> nil,
> ['ClassVarDeclNode', 1, 1, 13, 24],
> ['FixnumNode', 1, 1, 24, 24],
> nil,
> ['DefnNode', 2, 5, 28, 77],
> ['ArgumentNode', 2, 2, 32, 34],
> ['ArgsNode', 2, 3, 35, 36],
> ['ScopeNode', 3, 4, 45, 70],
> ['BlockNode', 3, 4, 45, 70],
> nil,
> ['InstAsgnNode', 3, 3, 40, 54],
> ['DStrNode', 3, 3, 54, 55],
> ['DStrNode', 3, 3, 54, 54],
> ['StrNode', 3, 3, 49, 54],
> nil,
> ['LocalAsgnNode', 4, 4, 60, 71],
> ['FixnumNode', 4, 4, 71, 71]
> ]
> 
> test_tree(list, <<END)
> class Test
>   @@static = 5
>   def foo
>     @field = "test"
>     localvar = 0
>   end
> end
> END



-- 
+ 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to