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

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.0
File Size Uploaded Provenance Actions
tree_sitter_perl-2.1.0.tar.gz 629.2 kB With provenance Details for tree_sitter_perl-2.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / tree_sitter_perl-2.1.0.tar.gz

Download URL tree_sitter_perl-2.1.0.tar.gz
Size 629.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a7252cfb55030a46eeb49d32f7f84f6387cd8cd085736f593627d09fcc9341b
BLAKE2b-256 checksum
How to use checksums
366d17c47d12661081a33b7246dbb31e4b0e1d98f69fb83707d85071445892bc
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-win_amd64.whl
Size 161.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
33f4f1a2144bae19f63f4cf653594403a181091220bb6adc92c395cd3f49324f
BLAKE2b-256 checksum
How to use checksums
d8b266ff5f3d02b2e5b7d652afbca9128e52c981a05499557ab47347f5da37e0
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 258.5 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
7ed1716811d6deae165938cf4b8a1713f9f0d7f164b7f7ef0ba2f00e6adb38f1
BLAKE2b-256 checksum
How to use checksums
0fcb6cb5a38383cc02357890bfaf8e1d2d21812be2d544172da0b794ae02bff9
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 269.6 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
d72fb5df3aeaa3439320f88092be505b8f6bc88f4234e9ce71eee28e5fc3c498
BLAKE2b-256 checksum
How to use checksums
8b33b768b2a6d77a21c3dd352384c523d2220ba3e765ad9a60146e9ac7f97f74
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 272.5 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
aa670bf9f874aec1b1f43affac816af98713bcd84b5bee4de456d4093bc0ae6e
BLAKE2b-256 checksum
How to use checksums
dce4bebec7eeeafc972c87867ca2d92706ca1111e8f43214aa05e9d77c71d5b5
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 261.9 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
a97e1f0062100847893cf075cc6b95b4a856ecd3bdd4061991f1f9b71abcc10f
BLAKE2b-256 checksum
How to use checksums
f3ebd1f64818732ba93e1628c3a947c37d597bf285edb5f6b50d9daed135ed54
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 15, 2026.

Transparency log

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

Download URL tree_sitter_perl-2.1.0-cp39-abi3-macosx_11_0_arm64.whl
Size 170.1 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a2a540ce34b401f30f528bc1f4023111079cd97d80794e2ad5159e69e5c3d87c
BLAKE2b-256 checksum
How to use checksums
cf0ae291c6af5d0a79ba8a50f3a0447cd0b5fa9e3de1013834893448a701beee
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 15, 2026.

Transparency log

Security for tree-sitter-perl 2.1.0

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.0.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 15, 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