Skip to content

Commit

Permalink
Fix ASTConverter18Test.test0009 - illegal argument
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Dec 10, 2024
1 parent 0615a26 commit bab45c4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,14 @@ public void postVisit(ASTNode node) { // fix some positions
int parentEnd = parentStart + node.getParent().getLength();
int newParentStart = parentStart;
int newParentEnd = parentEnd;
if( myStart >= 0 && myStart < parentStart) {
if( parentStart != -1 && myStart >= 0 && myStart < parentStart) {
newParentStart = myStart;
}
if( myStart >= 0 && myEnd > parentEnd) {
if( parentEnd != -1 && myStart >= 0 && myEnd > parentEnd) {
newParentEnd = myEnd;
}
if( parentStart != newParentStart || parentEnd != newParentEnd) {
if( newParentStart != -1 && newParentEnd != -1 &&
parentStart != newParentStart || parentEnd != newParentEnd) {
node.getParent().setSourceRange(newParentStart, newParentEnd - newParentStart);
}
}
Expand Down

0 comments on commit bab45c4

Please sign in to comment.