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

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.6
File Size Uploaded Provenance Actions
tree_sitter_perl-2.0.6.tar.gz 1.7 MB With provenance Details for tree_sitter_perl-2.0.6.tar.gz

Built distributions (wheels)

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

Total release size: 3.9 MB

Release files / tree_sitter_perl-2.0.6.tar.gz

Download URL tree_sitter_perl-2.0.6.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
7236dd27a76354c4729ca92f1a6c69bb7f52f314efef55496d9ff597f33a9b4e
BLAKE2b-256 checksum
How to use checksums
0c6cf47c2cf8a8b2f05052694656216feefc7597b6b442daea428d68821f8157
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-win_amd64.whl
Size 318.7 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
18c4fe13941542ee0f5efbf2804b12e9b15e7148aed4cb3c19a19facfe038a45
BLAKE2b-256 checksum
How to use checksums
55de151b0e15880fc8e8ee5a07adb81882232e3d88e487e7631993fd5320fd1e
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-musllinux_1_2_x86_64.whl
Size 374.8 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
29e2fca553520887041023c260a4821ddaab2667239bf87ca021111794e23b5b
BLAKE2b-256 checksum
How to use checksums
52f73cbaac66b75d7a80de70830773c4ef6a13698dea77c8642d1fd63374036f
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-musllinux_1_2_aarch64.whl
Size 372.5 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
aea077440760eb037135cacc30579dc8bb07decbe13e7cdbf57520dad7579829
BLAKE2b-256 checksum
How to use checksums
4b23c6811f525c09e4bce8c765341ef7d65d236afb6d3fe01651c2cef268097e
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 374.9 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
0bb7ba3863c294b58d70028fe66ef7359f2932eddedd38a90bb871fe4644595f
BLAKE2b-256 checksum
How to use checksums
76b312d78441649751aa341356676dee6dc9c65aab5291728b455c6421e95d97
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 376.5 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
b5a34f00c5a9875a885cbf20ce59f0910aa8b838e9e9ee4591640715524e90aa
BLAKE2b-256 checksum
How to use checksums
4bfd3fa9911039a3735c14eb32e2283a1db3785ef8047d7d309980ee0da6153b
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 12, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.6-cp39-abi3-macosx_11_0_arm64.whl
Size 345.1 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c0325d780a189e03c0188acae2a81970ec36878266df86cf3f9ca70cbd146674
BLAKE2b-256 checksum
How to use checksums
d1d0cf98a531b42ff3a4661fb0781c632c4838ed9565739ba1fe892d88fddf03
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 12, 2026.

Transparency log

Security for tree-sitter-perl 2.0.6

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.6.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 12, 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