for a language too cool to abide by conventions.
+@defun treesit-language-version &optional min-compatible
+Tree-sitter library has a @dfn{language version}, a language
+definition's version needs to match this version to be compatible.
+
+This function returns tree-sitter library’s language version. If
+@var{min-compatible} is non-nil, it returns the minimal compatible
+version.
+@end defun
+
@heading Concrete syntax tree
A syntax tree is what a parser generates. In a syntax tree, each node
return Qt;
}
+DEFUN ("treesit-language-version",
+ Ftreesit_language_version,
+ Streesit_language_version,
+ 0, 1, 0,
+ doc: /* Return the language version of tree-sitter library.
+If MIN-COMPATIBLE non-nil, return the minimal compatible version. */)
+ (Lisp_Object min_compatible)
+{
+ if (NILP (min_compatible))
+ return make_fixnum (TREE_SITTER_LANGUAGE_VERSION);
+ else
+ return make_fixnum (TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION);
+}
+
/*** Parsing functions */
static void