fix(lib): check if an ERROR node is named before assuming it's the builtin error node
(cherry picked from commit b7f36a13ba)
This commit is contained in:
parent
1083795af6
commit
22fa144016
4 changed files with 47 additions and 2 deletions
|
|
@ -186,7 +186,7 @@ TSSymbol ts_language_symbol_for_name(
|
|||
uint32_t length,
|
||||
bool is_named
|
||||
) {
|
||||
if (!strncmp(string, "ERROR", length)) return ts_builtin_sym_error;
|
||||
if (is_named && !strncmp(string, "ERROR", length)) return ts_builtin_sym_error;
|
||||
uint16_t count = (uint16_t)ts_language_symbol_count(self);
|
||||
for (TSSymbol i = 0; i < count; i++) {
|
||||
TSSymbolMetadata metadata = ts_language_symbol_metadata(self, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue