On Tue, 25 Apr 2006, Mirko Stocker defenestrated me:
>
> Hi!
> 
> I'm currently analyzing the JRuby AST to create refactorings for the RDT. To 
> analyze the AST, im just stepping through it with the Debugger, and i'm 
> wondering if the SourcePositions in the AST are correct. with this Class:
> 
> class Test
>   def initialize
>     @field = "test"
>   end
> end
> 
> the InstAsgnNode has the position 37-40, which certainly isn't correct, or am 
> I mistaken? This range includes 'd = ', but I expected '@field'. Which leads 
> my to my next question, how is the counting of the ranges meant?  Is '37' the 
> index or the 37th character? What about newlines? I'd really appreciate your 
> help, I think I'm quite confused at the moment :-)

  This is probably an error in our positioning.  I got several important 
positions working properly, but not all of them.  If you look at 
test/testPositions.rb in our sourcecode, you can see the nodes I last 
concentrated on.  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).

  The positions are as follows:
1. index of first character for node
2. index of last character for node
3. start line for node
4. end line for node

  Just guessing I think startIndex should be 32 and endIndex should
be 46 (maybe 47 if we include newline in there or not).

-Tom

-- 
+ 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