feat!: introduce parser introspection via the repo's Semantic Version baked in
This commit is contained in:
parent
b66b1a7a92
commit
2c192fa038
15 changed files with 1862 additions and 2156 deletions
|
|
@ -48,10 +48,10 @@ class ParserImpl {
|
|||
language = null;
|
||||
} else if (language.constructor === Language) {
|
||||
address = language[0];
|
||||
const version = C._ts_language_version(address);
|
||||
const version = C._ts_language_abi_version(address);
|
||||
if (version < MIN_COMPATIBLE_VERSION || VERSION < version) {
|
||||
throw new Error(
|
||||
`Incompatible language version ${version}. ` +
|
||||
`Incompatible language abi version ${version}. ` +
|
||||
`Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`,
|
||||
);
|
||||
}
|
||||
|
|
@ -680,8 +680,12 @@ class Language {
|
|||
}
|
||||
}
|
||||
|
||||
get version() {
|
||||
return C._ts_language_version(this[0]);
|
||||
get abiVersion() {
|
||||
return C._ts_language_abi_version(this[0]);
|
||||
}
|
||||
|
||||
get semanticVersion() {
|
||||
return C._ts_language_semantic_version(this[0]);
|
||||
}
|
||||
|
||||
get fieldCount() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue