Closed pouryafard75 closed 1 month ago
Hi! Thanks for the bug report! It seems that we don't support node position in the tree created using Gumtree APIs even though Gumtree provides with APIs such as .setPos
and .setLength
.
May I ask what kind of position are you interested in? Should it be line number-based or column-based?
I would like to have the exact offsets similar to the way that GT jdt visitor provides. [Startoffset-EndOffset]
I believe I could add integers returned by these two APIs then. I understand that it gives the index of start and end character.
That would be perfect. I couldnt make it work because the position was from NoSourcePosition, but I am pretty sure you know how to deal with that.
work because the position was from NoSourcePosition
That would be the case for implicit elements like default constructor, but for other elements, it should work. Gumtree tree based on Spoon should not contain implicit elements in my opinion. It is a good point and I will add a test for it.
Hello, I am just getting started with Spoon.
I am trying to add GT-Spoon as one of the tools for our DiffBenchmark. However, I stumbled upon a problem which is having zeros as all the offsets. Our benchmark is originally built for gumtree-jdt visitor but we want to find the eqv subtree for other visitors by relying on the offsets.
I have tried the ASTComperator with the annotation example, and tried to print the generated trees using the following code:
However the offsets are all shown as zero: