On Tuesday 25 April 2006 16:46, Thomas E Enebo wrote:
>   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).

Ok, I'll take a look and see what I can do. 

>   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).

That's what I expected, too. For our project we have to rely on correct 
positions (or have to create a workaround for the wrong ones), because we'd 
like to reconstruct the sourcefile from the AST. Well, that's what we wish we 
could do, we aren't sure if it's possible without losing too much information 
from the original file.

And by the way, am I right that comments aren't in the AST? Because that's the 
next thing that gives me a headache :)

Thanks!

Mirko

Attachment: pgpog3epIVOhb.pgp
Description: PGP signature

Reply via email to