Fix incorrect cast in ts_language_symbol_is_in_progress

This commit is contained in:
Max Brunsfeld 2016-04-17 23:09:49 -07:00
parent 655d374d0c
commit f63fcffe95
2 changed files with 5 additions and 6 deletions

View file

@ -83,7 +83,7 @@ typedef union {
typedef union {
TSSymbol symbol;
unsigned int count;
unsigned short count;
} TSInProgressSymbolEntry;
struct TSLanguage {

View file

@ -56,11 +56,10 @@ bool ts_language_symbol_is_in_progress(const TSLanguage *self, TSStateId state,
if (state == ts_parse_state_error)
return false;
unsigned index = self->in_progress_symbol_table[state];
size_t count = self->in_progress_symbols[index].count;
const TSSymbol *symbols = (TSSymbol *)(self->in_progress_symbols + index + 1);
for (size_t i = 0; i < count; i++) {
if (symbols[i] == symbol)
unsigned short count = self->in_progress_symbols[index].count;
const TSInProgressSymbolEntry *entries = self->in_progress_symbols + index + 1;
for (size_t i = 0; i < count; i++)
if (entries[i].symbol == symbol)
return true;
}
return false;
}