NAME

Text::Treesitter::Language - represents a tree-sitter language grammar

SYNOPSIS

TODO

DESCRIPTION

Instances of this class represent an entire language grammar specification. Typically an application will load just one of these for the lifetime of its operation; or at least, just one per type of language being parsed.

UTILITY FUNCTIONS

These utility functions are not exported, and must be called fully-qualified.

build

Text::Treesitter::Language::build( $output, @dirs );

Requests that a language grammar repository directory (or several) be compiled into an object file that can later be loaded.

load

$lang = Text::Treesitter::Language::load( $libfile, $name );

Attempts to actually load the grammar specification from the object file. The object file must have been previously built (either by calling "build", or obtained in some other way).

An instance of Text::Treesitter::Language is returned. This can be passed to the set_language method of a Text::Treesitter::Parser instance.

Currently this class does not provide any perl-visible methods.

TODO

The following C library functions are currently unhandled:

ts_language_symbol_count
ts_language_symbol_name
ts_language_symbol_for_name
ts_language_field_count
ts_language_field_name_for_id
ts_language_field_id_for_name
ts_language_symbol_type
ts_language_version

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>