feat(lib): add the language name

This commit is contained in:
ObserverOfTime 2024-03-17 10:53:06 +02:00 committed by Amaan Qureshi
parent 42dd32d184
commit c5ee0ac070
5 changed files with 17 additions and 0 deletions

View file

@ -28,6 +28,10 @@ uint32_t ts_language_version(const TSLanguage *self) {
return self->version;
}
const char *ts_language_name(const TSLanguage *self) {
return self->version >= LANGUAGE_VERSION_WITH_METADATA ? self->name : NULL;
}
uint32_t ts_language_field_count(const TSLanguage *self) {
return self->field_count;
}