Languages

NAME

TreeSitter::Native::Languages - the nine bundled grammars, by name

SYNOPSIS

use TreeSitter::Native::Languages;
say languages;                  # (c cpp go java javascript python
                                    #  rust tsx typescript)
    say language-abi('python');     # 15
my $lang = language('rust');    # a TSLanguage, ready for a Parser
# The grammar authors' own queries, vendored at the pinned tag.
    my $tags = tags-query('go');
    my $hl   = highlights-query('go');
    my $loc  = query-source('typescript', 'locals');

DESCRIPTION

Nine grammars are linked into the shared library β€” there is no dynamic grammar loading, and no tree-sitter-cli at runtime. This module is the map from a name to the compiled grammar, and from a name to the .scm query files that grammar ships.

The queries are vendored in this distribution's resources/, copied verbatim from each grammar repository at the tag pinned in SOURCE_PINS. They are MIT-licensed by their authors; see resources/licenses/. Reading them needs no native library at all, which is what makes the query surface testable offline.

There is deliberately no Raku grammar: no usable tree-sitter grammar for Raku exists at the time of writing. That is a limitation of the ecosystem, not an omission here.

TreeSitter::Native v0.1.0

parse and navigate source code with tree-sitter

Authors

  • Matt Doughty

License

Artistic-2.0

Dependencies

NativeCall

Test Dependencies

Provides

  • TreeSitter::Native
  • TreeSitter::Native::FFI
  • TreeSitter::Native::Languages
  • TreeSitter::Native::Query
  • TreeSitter::Native::Types

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite β€” the markup and publishing tools behind this site.