Add wasm binding for running tree queries in a limited range

This commit is contained in:
Max Brunsfeld 2019-09-11 14:44:49 -07:00
parent 0528ad5f58
commit 49ce2fddb9
6 changed files with 143 additions and 24 deletions

View file

@ -96,7 +96,8 @@ TSFieldId ts_language_field_id_for_name(
for (TSSymbol i = 1; i < count + 1; i++) {
switch (strncmp(name, self->field_names[i], name_length)) {
case 0:
return i;
if (self->field_names[i][name_length] == 0) return i;
break;
case -1:
return 0;
default:

View file

@ -783,6 +783,7 @@ bool ts_query_cursor_next(TSQueryCursor *self) {
.step_index = slice->step_index,
.pattern_index = slice->pattern_index,
.capture_list_id = capture_list_id,
.capture_count = 0,
}));
}