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

Built distributions (wheels)

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

Total release size: 3.9 MB

Release files / tree_sitter_perl-2.0.2.tar.gz

Download URL tree_sitter_perl-2.0.2.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
ef4cb1dbb7989a3b1041be93fb1c109621da5611aae7507a7a8d5360a0381b67
BLAKE2b-256 checksum
How to use checksums
51e631d7ad7abba41cc4bed10e88efb4744ba13fa1d05b3a8c0d113090653c99
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-win_amd64.whl
Size 319.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2fef4ddf097ea3b854b03ead71e37eacaed9f0b6c608e9073131732d6d5fb322
BLAKE2b-256 checksum
How to use checksums
d6602abe04b2ad0d666f5bb81aa14683c208c662fc6fcccaa0342c9e55df689e
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-musllinux_1_2_x86_64.whl
Size 375.9 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ff0095ae0970b89a0a5d279ec998e90baa486073605a3b05c33a75b3f15cb576
BLAKE2b-256 checksum
How to use checksums
e8cf09a535e20ea0f21e32dc32ee5285ccccde3d2caa9f418ade6a8afc69fd19
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-musllinux_1_2_aarch64.whl
Size 373.2 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
cbc85ae33b1fa1f9ed1ecaf54d915746007f1bcc9c1198b41d645817f784af00
BLAKE2b-256 checksum
How to use checksums
2c15804f2b3e67c1c99877329c96f2ce4999a95d111d61fdd9ad6e127efab681
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 375.7 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
4ebba05d749dae83118aad11f93f6145aeef3e04f80d190314b8eed107d2dc02
BLAKE2b-256 checksum
How to use checksums
49b578d806a6641fa70cf9674387d921333232c2ea12585bf766467eb8d43338
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 377.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
cec1c12c4d1c74330b565eb4122c51bf3b4098cc624db4ad79780388c0416911
BLAKE2b-256 checksum
How to use checksums
6d71eb723a651dd4b80a424eb9fe4873f00d740dec8227e6a48c0e3e6afdd1f4
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 26, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.0.2-cp39-abi3-macosx_11_0_arm64.whl
Size 346.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b2ea36f55d9f9b076fa8df5fcf31808e69d624c1648c233bc02c793d71c04bb8
BLAKE2b-256 checksum
How to use checksums
a1d13c35253e4d380db1f664b058630610a8640b5a3f20b3a576a952754355f2
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 26, 2026.

Transparency log

Security for tree-sitter-perl 2.0.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.0.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 Oct 26, 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