Skip to content

Commit

Permalink
feat(query): add ability to disable captures
Browse files Browse the repository at this point in the history
  • Loading branch information
xcb-xwii committed Jul 29, 2024
1 parent 36aee2c commit 9a56ce1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/query/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,24 @@ static int LTS_query_delete(lua_State *L) {
return 0;
}

static int LTS_query_disable_capture(lua_State *L) {
TSQuery *query = *LTS_check_query(L, 1);
size_t len;
const char *name = luaL_checklstring(L, 2, &len);

ts_query_disable_capture(query, name, len);

return 0;
}

static const luaL_Reg metamethods[] = {
{ "__gc", LTS_query_delete },
{ NULL, NULL }
};

static const luaL_Reg funcs[] = {
{ "new", LTS_query_new },
{ "disable_capture", LTS_query_disable_capture },
{ NULL, NULL }
};

Expand Down

0 comments on commit 9a56ce1

Please sign in to comment.