Skip to main content

tree-sitter-perl

A tree-sitter grammar for Perl. Maintained at https://github.com/tree-sitter-perl/tree-sitter-perl

Installation

Package managers

# npm
npm install tree-sitter-perl

# cargo
cargo add ts-parser-perl

# pip
pip install tree-sitter-perl

Neovim

A version of this parser is part of the nvim-treesitter plugin.

To use a version that has not yet made it into nvim-treesitter:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.perl = {
  install_info = {
    url = 'https://github.com/tree-sitter-perl/tree-sitter-perl',
    revision = 'release',
    files = { "src/parser.c", "src/scanner.c" },
  }
}

Then :TSInstall perl. Copy the queries from the queries directory into queries/perl somewhere in your runtimepath.

Emacs

As of Emacs 29.1, if you have the tree-sitter library installed:

(setq treesit-language-source-alist
  '((perl . ("https://github.com/tree-sitter-perl/tree-sitter-perl" "release"))))
(treesit-install-language-grammar 'perl)

From source

Pre-built files are on the release branch. We don't store generated files on master because the 18MB parser.c makes branch switching painful.

Developing

Prerequisites

Install the tree-sitter CLI. Node.js v20+ is needed for tree-sitter generate (the grammar uses advanced regex features for unicode support).

Building

tree-sitter generate   # generates src/parser.c from grammar.js
tree-sitter test       # runs the test corpus
cargo test             # runs the Rust binding tests

If you aren't changing grammar.js, you can generate from the checked-in src/grammar.json with just the tree-sitter CLI (no Node needed):

tree-sitter generate src/grammar.json

Releasing

script/schema-diff                 # what changed in the public node schema, and the bump it implies
script/bump-version 2.0.0          # syncs version across all four manifests
git add -A && git commit           # NOTE: no -m — see below
git tag v2.0.0
git push origin master v2.0.0      # tag push triggers publish to npm, crates.io, PyPI, GitHub

The tag commit's message body becomes the GitHub release notes — publish.yml extracts it with git log -1 --format=%b. Committing with -m 'chore: bump …' alone therefore publishes a release with no notes; write the notes into the commit body. CI fails the publish if that body is empty.

script/bump-version --check verifies every manifest agrees; CI runs it on each pull request.

Tests

Tests are in test/corpus/. Reference: https://tree-sitter.github.io/tree-sitter/creating-parsers#command-test

Contributing

Pull requests welcome! The grammar is in grammar.js. For subtle points, please leave comments — the extra bytes go a long way.

Supporting scripts

unicode_ranges.pl generates unicode ranges for the C and JS sides of the parser. Dependencies are in the cpanfile. Only needed if working on unicode identifiers.

Metadata

Release files for tree-sitter-perl 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-perl 2.0.1
File Size Uploaded Provenance Actions
tree_sitter_perl-2.0.1.tar.gz 1.7 MB With provenance Details for tree_sitter_perl-2.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-perl 2.0.1
File Actions
tree_sitter_perl-2.0.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for tree_sitter_perl-2.0.1-cp39-abi3-win_amd64.whl
tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_x86_64.whl
tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_aarch64.whl
tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 Details for tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
tree_sitter_perl-2.0.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for tree_sitter_perl-2.0.1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 3.9 MB

Release files / tree_sitter_perl-2.0.1.tar.gz

Download URL tree_sitter_perl-2.0.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4e4a2e47695107eeb68fdec7553f4668539d38b2e00f910e539531f16857a15e
BLAKE2b-256 checksum
How to use checksums
d4bdb886e18fd33c48cfb1c704601aa4b98d4bdb25985f20f1bb93c2a6aa3202
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-win_amd64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-win_amd64.whl
Size 319.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ec201ea645455f96ab15b144c81722bf546786a41aa31a3cf6f6cfdc5bdb8596
BLAKE2b-256 checksum
How to use checksums
7c8fcc71e998b3e52c2e36447e82b7d982da0cb354a9bbb5962b16bd7b549084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 371.7 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3dc721aa82488c58d8c1abd352d9fe74666357e9f78d4d9385e1fc0f7de23681
BLAKE2b-256 checksum
How to use checksums
1ee6f1fb500004d3269bc4403552272f3b9fe6fe95cebf208cc8eedba166de7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 369.6 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
20986c5936b2708735a8d41d1f1798e10c131407d9b155827a6dd20e604a93ee
BLAKE2b-256 checksum
How to use checksums
08c96c8ab9f345949fd545858f7e24cb684c061573a74f47622490aab943f711
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 407.6 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fd551502c03652c1dbec9e01a20f643edbc8134a07d7b27f4a1fdd2fbb22407b
BLAKE2b-256 checksum
How to use checksums
eff7fb84ca9def15b37e9e489f418617a8781e0683d525d8a6c18b1199f364fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 383.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
49a6fd6be3aa259a535cc561580d0f2753c9dbc2f393f1a8894a84a465e55bde
BLAKE2b-256 checksum
How to use checksums
6616e274648b3275ac1e2545e1949ea88e3db8533b38b370b5b18ad72810ab69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / tree_sitter_perl-2.0.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_perl-2.0.1-cp39-abi3-macosx_11_0_arm64.whl
Size 346.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ceea843e77d4d5d8fd283046a033bdfa18173bef29992d0c19aca7159a56cb6c
BLAKE2b-256 checksum
How to use checksums
2895687d52408d6d3bfb9df6e5ea04e77150a3e5148a29d167e221eb8a3a4a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for tree-sitter-perl 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for tree_sitter_perl-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page