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.3

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.3
File Size Uploaded Provenance Actions
tree_sitter_perl-2.0.3.tar.gz 1.8 MB With provenance Details for tree_sitter_perl-2.0.3.tar.gz

Built distributions (wheels)

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

Total release size: 4.0 MB

Release files / tree_sitter_perl-2.0.3.tar.gz

Download URL tree_sitter_perl-2.0.3.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
ffb1b2d8752b60a9befaa1fc5dc989fe3e7a96ea040df8bb39abc19b8dae5650
BLAKE2b-256 checksum
How to use checksums
f92c5dbd7b7365ad1242e1267dafce84a105a8dbd1c591739f5804e68546f527
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-win_amd64.whl
Size 321.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
95de0f91d980a342a89e39eb99ecefedbee5fc7a914e408516e762ae55eddfb2
BLAKE2b-256 checksum
How to use checksums
1473563ebc034447043feb6dea67816111dabe0e1353267838e3d03aa8faa5e2
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-musllinux_1_2_x86_64.whl
Size 378.1 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
86a3471ac33062afd55f4aafe3fbe38952f06e0439e26736b62bf740e184be11
BLAKE2b-256 checksum
How to use checksums
a36eb071cae9c9a5bf4ca3057bf480d924c80067cec3a52200c9e5686d116130
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-musllinux_1_2_aarch64.whl
Size 375.2 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
79fdfc140d73edb2f5fcd4fb2436d3ad097c8391ade201980a00d6e738db2661
BLAKE2b-256 checksum
How to use checksums
7ad65064fa0f02f86401bffd4d0d1a549e86c62449432f2f13a6ec6b7e864c76
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 377.6 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
1025298a8ab301d62fd0ae9e71aaa083782517f49bacb843e9b1cf5f9046cd7c
BLAKE2b-256 checksum
How to use checksums
6051085e7cf584fb854f92fc975c5282fc7039df99ab24d5772acefc5dc3825b
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 379.8 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
818fc9d3e3ca27d07e59db206af53d9985caa9f179c90d6b177afb588db799d8
BLAKE2b-256 checksum
How to use checksums
9f6800d64649389bc0e3ae45f111353c3f6950eba701022a8d65b99420b29080
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 27, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.3-cp39-abi3-macosx_11_0_arm64.whl
Size 348.8 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8f8886be2dfbafaa0f5f1275fc250da3a39246a06da9694cfb9096e509f061c0
BLAKE2b-256 checksum
How to use checksums
71815a8e04ff9c590d3d1717d47fbfd4da987801bd079fb755e6f345019ed21e
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 27, 2026.

Transparency log

Security for tree-sitter-perl 2.0.3

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.3.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 27, 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