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

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

Built distributions (wheels)

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

Total release size: 3.9 MB

Release files / tree_sitter_perl-2.0.4.tar.gz

Download URL tree_sitter_perl-2.0.4.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
57f11d4bfb7387515e07065f39d1223d91d04fe4a3c96c36c68e5ff22201c12b
BLAKE2b-256 checksum
How to use checksums
86eaca711c91394b3eab53ecb9f42c224a8d0037b0b0c108f745e0571c1dca38
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-cp39-abi3-win_amd64.whl
Size 320.9 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
edd86041cdb7dce992e03840366c723807648c099827c5a9772c2224978e0b37
BLAKE2b-256 checksum
How to use checksums
313310d525d825eecd9c8e0423552d8ce1c72c49e295d24b7f4d53fa5ffe19b4
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-cp39-abi3-musllinux_1_2_x86_64.whl
Size 378.0 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
19fd8cf84ce35108481d1570b07f3b120b30082f25d2932925ac9a301a6eb4f3
BLAKE2b-256 checksum
How to use checksums
ea4be6bda1fe0c61e111616ef5477a600509c76c34a0bb8454ad0c2e116332dd
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-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
64e33618e83c1f7952de1f98f0cc2aa427a09cf537b46cab5207f53966255021
BLAKE2b-256 checksum
How to use checksums
fc94160ff11da4d2488ca1f3a981aaf8cd6ea19526adc8979804e541e3fada2c
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 377.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
138dff235dbd493acc54b5a8ccac156c6ca33f6234b15eead258f23c044b2db0
BLAKE2b-256 checksum
How to use checksums
90ff9e2c11694f87b5347dfd8e83bde20fc08ea44243c57c4eab64f4c0394c5c
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 379.6 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
a2eecbbdb3d68f42db451aa9eafd196cc73f99189a8f2b4eee78ef54d136fc07
BLAKE2b-256 checksum
How to use checksums
be2f628e49dc67986ce8cd96f557e1d87f36a383e27daef5317f07849b9cdeaa
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 3, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.4-cp39-abi3-macosx_11_0_arm64.whl
Size 348.2 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fceb9a9cd5a11fd45d48e3af5cb83ca200ea9e47d5f324e1718e527c5cd013df
BLAKE2b-256 checksum
How to use checksums
c3ecbb1d73e5da77b77ea872b9fc4bb67a8e8dcf151407e910626684c84ece2f
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 3, 2026.

Transparency log

Security for tree-sitter-perl 2.0.4

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