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

Releases are cut by CI. Merging a version bump to master releases it.

script/schema-diff                 # what changed in the public node schema, and the bump it implies
script/bump-version 2.0.5          # syncs the version across every manifest and package-lock.json

Then add a ## v2.0.5 — <date> section to CHANGELOG.md, the release notes, and open a pull request with both. When it merges, release.yml sees a version with no tag, creates the v2.0.5 tag and starts publish.yml on it, which publishes to npm, crates.io, PyPI and GitHub with that CHANGELOG section as the release body (script/release-notes v2.0.5 previews it).

script/bump-version --check verifies every manifest agrees; CI runs it on each pull request. release.yml adds --release, which also requires the CHANGELOG section, so a bump without notes is never tagged. Pushing a tag by hand still publishes it, through the same CHANGELOG section.

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.1.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.1.1
File Size Uploaded Provenance Actions
tree_sitter_perl-2.1.1.tar.gz 629.2 kB With provenance Details for tree_sitter_perl-2.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-perl 2.1.1
File Actions
tree_sitter_perl-2.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for tree_sitter_perl-2.1.1-cp39-abi3-win_amd64.whl
tree_sitter_perl-2.1.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.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
tree_sitter_perl-2.1.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for tree_sitter_perl-2.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
tree_sitter_perl-2.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details for tree_sitter_perl-2.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
tree_sitter_perl-2.1.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.9 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details for tree_sitter_perl-2.1.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
tree_sitter_perl-2.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for tree_sitter_perl-2.1.1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 2.0 MB

Release files / tree_sitter_perl-2.1.1.tar.gz

Download URL tree_sitter_perl-2.1.1.tar.gz
Size 629.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c456436026fda50f2e742cdddb9e95df494cbe1e9d29be85a06869c122580b79
BLAKE2b-256 checksum
How to use checksums
f9662f727cca7b84124fc4bd1806f9a92becbd5ab8038e5332f5e57229f831a9
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 Nov 19, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.1-cp39-abi3-win_amd64.whl
Size 161.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
22f8bb556d2bfcdac8f6323657dd896ffa5693fc66541536a3f7b91507bfbff4
BLAKE2b-256 checksum
How to use checksums
c5ce5fdb7332a784cb9fb88348d73c68893bf1f5d2baf8fde5b73b5c657e9004
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 Nov 19, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 258.3 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
120cb481dcadc68ae74fed5f4e01ea37848813c0e4e1be4fe83e858299042850
BLAKE2b-256 checksum
How to use checksums
803c4cbabc5fd6b5093ba7e308313b109758a35232a700b125a218d55f870004
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 Nov 19, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 269.6 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a6bf85b019940094525a1ec20d8cb0a43ac9c4573c7e0caee71981be75db94dd
BLAKE2b-256 checksum
How to use checksums
303934cd3ced608f84106c9d7deeb526a6dd33221ccf4784d169f1e596f3b669
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 Nov 19, 2026.

Transparency log

Release files / tree_sitter_perl-2.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL tree_sitter_perl-2.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 272.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
a442797a87b1b10840128f45e51a00d6fd171e850b1bc41aea52bd355e3bf8f2
BLAKE2b-256 checksum
How to use checksums
7f22d1e66b5c46236dba6c4b18677f16ec535caad0a72134a4a8060fa27974e9
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 Nov 19, 2026.

Transparency log

Release files / tree_sitter_perl-2.1.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL tree_sitter_perl-2.1.1-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 261.9 kB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
26e8b59ccc11b5bfada8efd2878d69eb0d7b14fcf0130ea4dedd02b7ac0e8913
BLAKE2b-256 checksum
How to use checksums
780d9fe1056bce7a1a2e755f32b788ef973b3f2a86d18fea28cb939720d51763
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 Nov 19, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 170.0 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
25bd97171857e82d5fc23c20e50da5afb07abcb6084aba52f467efd9d4c77f38
BLAKE2b-256 checksum
How to use checksums
19ce86898ccb8370550d4c68207f8099d25f7d0ebf4960f4884f06da5d9c9141
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 Nov 19, 2026.

Transparency log

Security for tree-sitter-perl 2.1.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.1.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 Nov 19, 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