Tree-Sitter-Pascal (and Delphi)
A Tree-sitter grammar supporting Pascal with focus on Delphi's Object Pascal, updated and focused on the latest language features. Support of other Pascal dialects like Free Pascal and Oxygene are also planned, and pull requests are welcome.
See also Delphi-tree-sitter bindings for consuming tree-sitter grammars from Delphi.
Contents
- What is Tree-sitter?
- Supported language features
- Tree-sitter features
- Python Package
- Pre-built Binaries
- Contributing
- Contributors
- License
What is Tree-sitter?
Tree-sitter is a incremental parsing system for programming tools. It is currently one of the most popular systems and grammars across all programming languages. It is useful for syntax highlighting, code navigation, and most recently for powering AST-based semantic code search (my next project).
Supported language features
- Classes, records, interfaces, class helpers
- Nested declarations
- Variant records
- Generics (Delphi & FPC flavored)
- Anonymous procedures & functions
- Inline assembler (but no highlighting)
- Extended RTTI attributes
- FPC PasCocoa extensions
- Ternary
ifExpressions (Delphi 13) - Extended Logical Operators (
is notandnot in) (Delphi 13) - Custom Managed Records (Delphi 10.4)
- Multi-line String Literals (Delphi 12)
- Numeric Separators (Delphi 12)
- Binary Literals (Delphi 12)
- Inline Variable & Constant Declarations (Delphi 10.3 / 12)
- Case
otherwiseKeyword (Free Pascal / ISO Pascal) - Nested Preprocessor Directives
Tree-sitter features
- Syntax highlighting
- Scopes
Python Package
The Python binding is published as tree-sitter-pascal and imported as tree_sitter_pascal.
python -m pip install tree-sitter-pascal
Python wheels are built with cibuildwheel and published through PyPI Trusted Publishing. Use the manual TestPyPI workflow first when validating a new release path. Production PyPI publishing runs only when a GitHub Release is published for a non-hyphenated release tag such as v0.11.0; auto-generated tags like v0.11.0-abc1234 are ignored.
Before the first upload, configure PyPI trusted publishers for the publish-testpypi.yml and publish-pypi.yml workflows, using the testpypi and pypi GitHub environments respectively.
Pre-built Binaries
Pre-built native libraries for all supported platforms are published with each GitHub Release:
| Platform | File |
|---|---|
| Windows x86 (32-bit) | tree-sitter-pascal-windows-x86.dll |
| Windows x64 (64-bit) | tree-sitter-pascal-windows-x64.dll |
| Linux x64 | tree-sitter-pascal-linux-x64.so |
| macOS Intel | tree-sitter-pascal-macos-x64.dylib |
| macOS Apple Silicon | tree-sitter-pascal-macos-arm64.dylib |
| WebAssembly | tree-sitter-pascal.wasm |
The tree-sitter.wasm core runtime (required for WASM use) is available from the tree-sitter releases.
The committed tree-sitter-pascal.wasm at the repository root is the release asset copy. The npm package also ships a second copy from bindings/node/tree-sitter-pascal.wasm because bindings/node/package.json includes *.wasm in its published files list.
Contributors
This is ultimately based on an original implementation by Isopod, with updates by Warren Postma. See our contributing guide.
License
I've migrated my updates to AGPL. I'm a big fan of open source. Unfortunately, I've seen too many companies take advantage of permissive licenses and turn an open source project into a closed source one. This is why I prefer AGPL. At the same time, I'm also a big fan of commercial software, which might seem incompatible. That is why I'm happy to provide a dual license. I'll set up a pricing structure later, but I just want to announce it is an option. Let me know if you are interested.
Metadata
Release files for tree-sitter-pascal 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_pascal-0.11.0.tar.gz | 293.6 kB | Details |
Built distributions (wheels)
Total release size: 2.1 MB
Release files / tree_sitter_pascal-0.11.0.tar.gz
| Download URL | tree_sitter_pascal-0.11.0.tar.gz |
|---|---|
| Size | 293.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d4da59b8c0b2ff9a32181562eed25c8ba13a6c8bbca2cb895e10f5344708dba
|
|
BLAKE2b-256 checksum How to use checksums |
8989cb9ce7f7e9a119a3d518020c387fb994f8f6cac07a3f796fbb3409b506fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl |
|---|---|
| Size | 124.9 kB |
| Tags | CPython 3.8 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9d22b974a47765f1c98629338d82d1df89c35c270a73f08dda8fbd49538e32d4
|
|
BLAKE2b-256 checksum How to use checksums |
45ade5381365ed5b247cad2e047682b081ccbb79f84bb5c1b48642ef3385f1d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 124.3 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
99346d54c928d42c820c0aa262f6acbf4fb2856d69016f1df11f834f681b45e0
|
|
BLAKE2b-256 checksum How to use checksums |
1996695db7513510ea4fedb5e4e9b47011bf309253715c5eb9892c71486312e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl |
|---|---|
| Size | 124.2 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
c898d8c2771c5da47dbab20aea1d99e3aca8878a90e24db0a5558619ac8ad5c5
|
|
BLAKE2b-256 checksum How to use checksums |
18803553a1c89441a8f78daedd6182580db4df234b6b4ddd0e9d18ac9a2f7385
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 152.1 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b545e3b7a20fc7f7ce346e0fc598120a90b980adf050357946b7b00d2a81f875
|
|
BLAKE2b-256 checksum How to use checksums |
0fbf5b64986483183667c086c6612185a03f3de2408f81b6bac49b60fa45c187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 157.2 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
ab2e43d9a4d30ee482322a41f7f12ca2f40b4f0ee1771646329fe57a6a6a29ba
|
|
BLAKE2b-256 checksum How to use checksums |
466eef2c893744b4d53f53113f7ca5bf3016afed6ced3db82ae7d3a42a2faf72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 152.7 kB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e317158e32c6e19ab75fe8664b48c48d71e757f6e2f8de0996eba63583d4ea55
|
|
BLAKE2b-256 checksum How to use checksums |
14056b103890fdb63c57fb89650ece51333852e0ee8a4a3ef0966168acebfad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 153.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
543717086ae596aa1895c6151230e45f78ed20a69b9c1ab83a5d5950db068381
|
|
BLAKE2b-256 checksum How to use checksums |
2034947ae7c72eac8363e3de08f2a1e2f992beeb6afb27daca939443438e4614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 153.6 kB |
| Tags | CPython 3.8 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ab7557a05400f2841b18d000997453dadff09c2830bd48313cf4264bab018bbe
|
|
BLAKE2b-256 checksum How to use checksums |
aa819e21b0199e86078ca4763ab4bc68fa6e1a3e625e168dee9fdcf27455d09f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 157.9 kB |
| Tags | CPython 3.8 Linux glibc 2.28+ x86-32 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
3ec2ca83d1e01a1eaf7711d6392947058c64302562f987be5c0bcf7e185d0dbd
|
|
BLAKE2b-256 checksum How to use checksums |
00b6e37df67cc704f9c19531c858835396366d39790e71114fa181929b0dba00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 132.3 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ed50bb16a8469a54ae365f51dac046a3247e2efbab203269a8d737fa816b11a6
|
|
BLAKE2b-256 checksum How to use checksums |
7e1e06f87ce971119b6a6c1682a0647cad9774463ae9c68faa8c016d8c10d30f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 125.5 kB |
| Tags | CPython 3.8 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
bccb2d757c17820cdcfaa760bac1df4caa6278e1e2334d6956e0f9c31c6e8f4a
|
|
BLAKE2b-256 checksum How to use checksums |
1e368660f400b1c42714f345fc0afae295be2fafec51531d199b7c6e2387881e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency logRelease files / tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl
| Download URL | tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl |
|---|---|
| Size | 238.0 kB |
| Tags | CPython 3.8 abi3 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
7a8c2bb6ab958cea7390e18ed28f4535ca24ba110eae0449d5a77c294844d45a
|
|
BLAKE2b-256 checksum How to use checksums |
9a74621a4d1690e224de4ae00fb90304469bd96c1ae25bd7a8eabb95f9809b90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 1, 2026.
Transparency log