The position holds both character indices and line indices. In your
class Test, the InstAsgn starts at or around the 37th character, which
is reflected in the position data.

If you check the starting line in the position data, you should get
the numbers you're expecting.

On 4/25/06, Mirko Stocker <[EMAIL PROTECTED]> wrote:
> 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 :-)
>
> Thanks!
>
> Mirko Stocker
>
> PS: If somebody is interested in our work, our project-website is located at
> http://morki.ch/rubyrefactoring (it's in german).
>
>
>


--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
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&kid0709&bid&3057&dat1642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to