Make ts_language_symbol_name return NULL for out-of-bound ids
This commit is contained in:
parent
c719e24a45
commit
23261c4f6f
2 changed files with 10 additions and 5 deletions
|
|
@ -72,8 +72,10 @@ const char *ts_language_symbol_name(
|
|||
return "ERROR";
|
||||
} else if (symbol == ts_builtin_sym_error_repeat) {
|
||||
return "_ERROR";
|
||||
} else {
|
||||
} else if (symbol < ts_language_symbol_count(self)) {
|
||||
return self->symbol_names[symbol];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue