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

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.2
File Size Uploaded Provenance Actions
tree_sitter_perl-2.1.2.tar.gz 629.3 kB With provenance Details for tree_sitter_perl-2.1.2.tar.gz

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / tree_sitter_perl-2.1.2.tar.gz

Download URL tree_sitter_perl-2.1.2.tar.gz
Size 629.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e892ca6da291afec190d4388fda636258f829886442e679b219930933b410aef
BLAKE2b-256 checksum
How to use checksums
8a5feab0c2e279c46157837ad1357001fc34654211180989bf9085f67f6196be
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-win_amd64.whl
Size 154.9 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8faec7d3e085ff0e2e8d5f633aa24ad4cc59ecf24d0b481091543d5a2ac88aaa
BLAKE2b-256 checksum
How to use checksums
7711d4f9f8a83ec63778159289c66bb68414bcbb31e5bd4d81d14d50e498c42a
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-musllinux_1_2_x86_64.whl
Size 260.8 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f0df9a5b1172cf553643f419360a509fdd9876b9ceb9459a55889e414ed1a106
BLAKE2b-256 checksum
How to use checksums
7e14fb7fcc19f317b856b56366c6cc7999d8a5edc40963296ea2e0aac96e52d8
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-musllinux_1_2_aarch64.whl
Size 272.7 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e8db954df657c5e5d2f1425d1c9649aac99e58a3390dec1bcd788044ed5d218b
BLAKE2b-256 checksum
How to use checksums
445e47df2638b026b6326691694975fed414392b0d8c77c78dcf282e12c99f26
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 275.7 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
b9f4f443267ca23468b8ba240c878d6bafa30288f38fbf9f0176e5b070938cf8
BLAKE2b-256 checksum
How to use checksums
5cf37fddea825aac6b54a53789a8acc61b3a01eebac65c488485ea825c520002
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 264.2 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
16ee007f60fb7d089dc87bc18ba5e9e2c13059194fe6f2948f9b0e865274aa95
BLAKE2b-256 checksum
How to use checksums
8d924bace0357a61bc5490e737da3863ec407e2f41a5e09d01333c0a27110756
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 20, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.2-cp39-abi3-macosx_11_0_arm64.whl
Size 170.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
08e07f63e1badeab63f94c58b7d64fc1bd526d52e35f5a19450b482b98c7bca6
BLAKE2b-256 checksum
How to use checksums
ea5dec8aaf30c3e03be0ad034c96a89c6e26eace893dadb1c445ab6e12ca5532
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 20, 2026.

Transparency log

Security for tree-sitter-perl 2.1.2

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.2.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 20, 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