JS: Fix perfomance issues in overlay mode.

This commit is contained in:
Alex Eyers-Taylor
2025-05-19 10:59:01 +01:00
parent 4bb829ebec
commit 64df703785

View File

@@ -28,8 +28,10 @@ class Token extends Locatable, @token {
/** Gets the token following this token inside the same toplevel structure, if any. */
Token getNextToken() {
this.getTopLevel() = result.getTopLevel() and
this.getIndex() + 1 = result.getIndex()
exists (TopLevel topLevel, int index |
tokeninfo(this, _, topLevel, index, _) and
tokeninfo(result, _, topLevel, index + 1, _)
)
}
/** Gets the token preceding this token inside the same toplevel structure, if any. */