ahh thx,

So in the current code real positions are stored and usable thats good to
know
Because thats in 1.6 really missing for tooling like the DLTK project.

johan



On Mon, Dec 8, 2008 at 19:00, Ryan Gustafson <[EMAIL PROTECTED]>wrote:

> Hi Johan,
>
> I've used the trunk API a bit over the weekend for something similar.
> You can get start/end like so:
>
>   AstNode node = ....
>   int startIndex = node.getAbsolutePosition();
>   int endIndex = startIndex + node.getLength();
>
> There are a couple bugs in the lengths on some of the nodes, and I
> submitted a bug with patch to correct them
> (https://bugzilla.mozilla.org/show_bug.cgi?id=468396).  To the extent
> I've used it so far, this seems to allow me to properly identify the
> exact source section for any AST node from the original full source.
>
> There is also AstNode.getPosition(), which gives you a position
> relative to the parent node.  I've not found a use for looking at the
> data in that perspective yet.
>
> I cannot answer your other questions.
>
> Ryan
>
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to