Closed algomaster99 closed 2 months ago
No tests fail right now because we never really tested for positions.
thanks a lot @algomaster99
let's add a new test case then!
@pouryafard75, I have added some preliminary tests to ensure things are working. Please try them out with your use case and report bugs. I will work more on this during weekend and then finally merge.
I have created tests which checks the following behavior:
start
and end
.The tests fail for 3 because https://github.com/INRIA/spoon/issues/5980.
EDIT: It can be zero length, see https://github.com/INRIA/spoon/issues/5980#issuecomment-2366884069.
@monperrus this is ready for merge.
thanks a lot @algomaster99
Fixes #323
We record start and end position characters in each node in the Gumtree tree. Thankfully, Spoon nodes provide this information in these two APIs.
Most of the nodes in Spoon are visited in
TreeScanner
and they are added to Gumtree AST. However, there are many more nodes created inNodeCreator
for which I have added the position manually. Hence, they require testing. This is why I am marking this PR as draft right now. I will add some tests soon and then merge. @pouryafard75, please try out this PR and report any bugs in the positions you get. It will also help me write tests. :)