Add version number to TSLanguage structs

This commit is contained in:
Max Brunsfeld 2017-01-31 10:21:47 -08:00
parent 672d491775
commit d853b6504d
6 changed files with 24 additions and 1 deletions

View file

@ -36,6 +36,7 @@ const TSLanguage *ts_document_language(TSDocument *self) {
}
void ts_document_set_language(TSDocument *self, const TSLanguage *language) {
if (language->version != TREE_SITTER_LANGUAGE_VERSION) return;
ts_document_invalidate(self);
parser_set_language(&self->parser, language);
if (self->tree) {