Allow queries to capture ERROR nodes

This commit is contained in:
Max Brunsfeld 2019-10-16 11:54:32 -07:00
parent 40408fe6bb
commit fa43ce01a6
2 changed files with 31 additions and 0 deletions

View file

@ -328,6 +328,7 @@ static TSSymbol ts_query_intern_node_name(
uint32_t length,
TSSymbolType symbol_type
) {
if (!strncmp(name, "ERROR", length)) return ts_builtin_sym_error;
uint32_t symbol_count = ts_language_symbol_count(self->language);
for (TSSymbol i = 0; i < symbol_count; i++) {
if (ts_language_symbol_type(self->language, i) != symbol_type) continue;