Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isExecuted of QueryCursor no longer relegated to native code #38

Merged
merged 2 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/ch_usi_si_seart_treesitter_QueryCursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ JNIEXPORT void JNICALL Java_ch_usi_si_seart_treesitter_QueryCursor_execute(
env->SetBooleanField(thisObject, _queryCursorExecutedField, JNI_TRUE);
}

JNIEXPORT jboolean JNICALL Java_ch_usi_si_seart_treesitter_QueryCursor_isExecuted(
JNIEnv* env, jobject thisObject) {
return env->GetBooleanField(thisObject, _queryCursorExecutedField);
}

JNIEXPORT jobject JNICALL Java_ch_usi_si_seart_treesitter_QueryCursor_nextMatch(
JNIEnv* env, jobject thisObject) {
bool executed = (bool)env->GetBooleanField(thisObject, _queryCursorExecutedField);
Expand Down
8 changes: 0 additions & 8 deletions lib/ch_usi_si_seart_treesitter_QueryCursor.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions src/main/java/ch/usi/si/seart/treesitter/QueryCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import lombok.AccessLevel;
import lombok.Generated;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import lombok.experimental.NonFinal;
import org.jetbrains.annotations.NotNull;

import java.util.Iterator;
Expand All @@ -22,7 +24,8 @@ public class QueryCursor extends External implements Iterable<QueryMatch> {
Node node;
Query query;

@SuppressWarnings("unused")
@Getter
@NonFinal
boolean executed = false;

@SuppressWarnings("unused")
Expand Down Expand Up @@ -53,12 +56,6 @@ public QueryCursor(@NotNull Node node, @NotNull Query query) {
*/
public native void execute();

/**
* @return {@code true} if the query was executed, {@code false} otherwise
* @since 1.5.0
*/
public native boolean isExecuted();

/**
* Advance to the next match of the currently running query.
*
Expand Down