Skip to main content

Pascal grammar for tree-sitter

Project description

Tree-Sitter-Pascal (and Delphi)

CI and Release Python Wheels

tree sitter Delphi logo - a hoplite/spartan warrior sitting in a tree next to a treehouse
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?

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 if Expressions (Delphi 13)
  • Extended Logical Operators (is not and not 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 otherwise Keyword (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.

Object Pascal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_pascal-0.11.0.tar.gz (293.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl (124.9 kB view details)

Uploaded CPython 3.8+Windows ARM64

tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl (124.3 kB view details)

Uploaded CPython 3.8+Windows x86-64

tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl (124.2 kB view details)

Uploaded CPython 3.8+Windows x86

tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl (152.1 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl (157.2 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl (152.7 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (153.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (153.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl (157.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ i686manylinux: glibc 2.5+ i686

tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl (132.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl (125.5 kB view details)

Uploaded CPython 3.8+macOS 10.9+ x86-64

tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl (238.0 kB view details)

Uploaded CPython 3.8+macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file tree_sitter_pascal-0.11.0.tar.gz.

File metadata

  • Download URL: tree_sitter_pascal-0.11.0.tar.gz
  • Upload date:
  • Size: 293.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tree_sitter_pascal-0.11.0.tar.gz
Algorithm Hash digest
SHA256 7d4da59b8c0b2ff9a32181562eed25c8ba13a6c8bbca2cb895e10f5344708dba
MD5 2bb96a86a020f0a603026614ac7e1982
BLAKE2b-256 8989cb9ce7f7e9a119a3d518020c387fb994f8f6cac07a3f796fbb3409b506fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0.tar.gz:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9d22b974a47765f1c98629338d82d1df89c35c270a73f08dda8fbd49538e32d4
MD5 ecb244a5933bdba3493d862e211a8162
BLAKE2b-256 45ade5381365ed5b247cad2e047682b081ccbb79f84bb5c1b48642ef3385f1d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 99346d54c928d42c820c0aa262f6acbf4fb2856d69016f1df11f834f681b45e0
MD5 ba2f66118f3ef3cfcc8e8f015301e770
BLAKE2b-256 1996695db7513510ea4fedb5e4e9b47011bf309253715c5eb9892c71486312e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 c898d8c2771c5da47dbab20aea1d99e3aca8878a90e24db0a5558619ac8ad5c5
MD5 90fa41d0b10e8c82ff2005f3fc51ba73
BLAKE2b-256 18803553a1c89441a8f78daedd6182580db4df234b6b4ddd0e9d18ac9a2f7385

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b545e3b7a20fc7f7ce346e0fc598120a90b980adf050357946b7b00d2a81f875
MD5 bbb53dd64a3b77f5ede1d8acf592356a
BLAKE2b-256 0fbf5b64986483183667c086c6612185a03f3de2408f81b6bac49b60fa45c187

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ab2e43d9a4d30ee482322a41f7f12ca2f40b4f0ee1771646329fe57a6a6a29ba
MD5 e69c8dbe32e493c6e213b395214c96eb
BLAKE2b-256 466eef2c893744b4d53f53113f7ca5bf3016afed6ced3db82ae7d3a42a2faf72

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e317158e32c6e19ab75fe8664b48c48d71e757f6e2f8de0996eba63583d4ea55
MD5 cd9366673b916bf3f8e15c848eb9563e
BLAKE2b-256 14056b103890fdb63c57fb89650ece51333852e0ee8a4a3ef0966168acebfad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 543717086ae596aa1895c6151230e45f78ed20a69b9c1ab83a5d5950db068381
MD5 88c3ab971b095dc476f1b91741e607e0
BLAKE2b-256 2034947ae7c72eac8363e3de08f2a1e2f992beeb6afb27daca939443438e4614

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ab7557a05400f2841b18d000997453dadff09c2830bd48313cf4264bab018bbe
MD5 0a284a6aec00ab4424d845d8c3bfbb8a
BLAKE2b-256 aa819e21b0199e86078ca4763ab4bc68fa6e1a3e625e168dee9fdcf27455d09f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
Algorithm Hash digest
SHA256 3ec2ca83d1e01a1eaf7711d6392947058c64302562f987be5c0bcf7e185d0dbd
MD5 d0380a202aac5327bb51062286406e66
BLAKE2b-256 00b6e37df67cc704f9c19531c858835396366d39790e71114fa181929b0dba00

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed50bb16a8469a54ae365f51dac046a3247e2efbab203269a8d737fa816b11a6
MD5 8075bc2594553f987739daa71b058d3a
BLAKE2b-256 7e1e06f87ce971119b6a6c1682a0647cad9774463ae9c68faa8c016d8c10d30f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bccb2d757c17820cdcfaa760bac1df4caa6278e1e2334d6956e0f9c31c6e8f4a
MD5 dc6ba1b5a0fef89726ec6e4323fb60b1
BLAKE2b-256 1e368660f400b1c42714f345fc0afae295be2fafec51531d199b7c6e2387881e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7a8c2bb6ab958cea7390e18ed28f4535ca24ba110eae0449d5a77c294844d45a
MD5 ec4cdfc5a1f283d615e7ab8888cc32d9
BLAKE2b-256 9a74621a4d1690e224de4ae00fb90304469bd96c1ae25bd7a8eabb95f9809b90

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl:

Publisher: publish-pypi.yml on jimmckeeth/tree-sitter-pascal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page