Skip to content

Commit

Permalink
ASTDiff: TreeUtilFunction look ahead bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pouryafard75 committed Dec 6, 2024
1 parent 668b1a4 commit fe2ada8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class TreeUtilFunctions {

public static Tree findByLocationInfo(Tree tree, LocationInfo locationInfo){
int start_offset = locationInfo.getStartOffset();
if (tree.getPos() > start_offset) return (tree.getParent() != null) ? findByLocationInfo(tree.getParent(),locationInfo) : null;
int end_offset = locationInfo.getEndOffset();
if (tree.getPos() > start_offset || tree.getEndPos() < end_offset) return (tree.getParent() != null) ? findByLocationInfo(tree.getParent(),locationInfo) : null;
return findByLocationInfoNoLookAhead(tree, locationInfo);
}

Expand Down

0 comments on commit fe2ada8

Please sign in to comment.