tree-sitter-dart
A tree-sitter grammar for the Dart programming language — which also covers Flutter (Flutter widgets are ordinary Dart classes; there is no separate Flutter syntax).
This is a fork of UserNobody14/tree-sitter-dart
(MIT) packaged and published as a Python distribution with pre-compiled
wheels (Linux/macOS/Windows), since no tree-sitter-dart existed on PyPI
compatible with tree-sitter>=0.23.
Python usage
pip install tree-sitter-dart # ships pre-compiled wheels; no C compiler needed
import tree_sitter_dart
from tree_sitter import Language, Parser
parser = Parser(Language(tree_sitter_dart.language()))
tree = parser.parse(b"class MyWidget extends StatelessWidget { Widget build(c) {} }")
print(tree.root_node.type) # -> program
language() returns a tree_sitter.Language PyCapsule, the standard
py-tree-sitter interface. Wheels are abi3 (CPython 3.8+).
Grammar development (Node / tree-sitter CLI)
This is a tree-sitter grammar written for the dart programming language. We attempt to adhere as closely as possible to the dart language spec. Initially it was started with a copy of the tree-sitter Java grammar which is why there may be a few relics included in here. For the sake of simplifying the syntax tree, many items were made inlined with tree-sitter's "underscore" method of writing rules.
Getting started
- Go to the project directory
- run
npm install(first time) - run
npm run build_init(first time)npm run build(subsequent times) - run
npm run test
To test a single highlight file
- run
tree-sitter highlight test/highlight/types.dart
To test a single test file
- run
tree-sitter test -f 'testcasefilter' - for example
tree-sitter test -f 'dart string literals'
To show the output of a parse for a sample file (for example while debugging highlight issues)
- run
tree-sitter parse path/to/file.dart
Credits
Grammar by UserNobody14 and contributors (MIT). This fork adds Python packaging, a modernized PyCapsule binding, and pre-compiled wheels.
Metadata
Release files for tree-sitter-dart 0.1.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_dart-0.1.0.tar.gz | 312.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tree_sitter_dart-0.1.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl | CPython 3.8 | abi3 | Linux musl 1.2+ x86-64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl | CPython 3.8 | abi3 | Linux musl 1.2+ ARM64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| tree_sitter_dart-0.1.0-cp38-abi3-macosx_10_13_x86_64.whl | CPython 3.8 | abi3 | macOS 10.13+ x86-64 | Details |
Total release size: 1.4 MB
Release files / tree_sitter_dart-0.1.0.tar.gz
| Download URL | tree_sitter_dart-0.1.0.tar.gz |
|---|---|
| Size | 312.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d1566e150f5ad8cd79ae225ff89db3eaf4a5e4cbbc667839578aee0512c3fdd
|
|
BLAKE2b-256 checksum How to use checksums |
7957e6d2294ab6f5c8fe5dd031837361ac256fecb7a285f06f665cafd6bf0a31
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-win_amd64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 128.1 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ee1d5f2109d2a206583227cfc4e2b0890f48700a0796207c2eecb5c3d7f23f63
|
|
BLAKE2b-256 checksum How to use checksums |
f7a7e8af7fb56dfd0d39df6f96e180d47d822407a7c98edc485b0c18ddd7ee28
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 162.6 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
05906d65a1c8688a0a0358c2e1b65ade0eec2ec7be7364c75de2f5c1e2844e0c
|
|
BLAKE2b-256 checksum How to use checksums |
43e3ebee709bdd1e472bfbd1f824e5377993cfcfb7437c9e9fedeac243480ac1
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 170.1 kB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a3b4d52633b48dc4f996c3b07694e2502d8d860aece0750c138ba4651cf8392b
|
|
BLAKE2b-256 checksum How to use checksums |
c5f89e204131897888bdd7f5f6220c312dd757f7b3b92a81d52faa1e63a51610
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 170.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
bb9a28e9c6cccfe9ca0aa44a47a1f9fb39bc9dbe7bc347bea4efef68bfe2f78a
|
|
BLAKE2b-256 checksum How to use checksums |
ec81f570a883d874c59845814afe6994cc74c2dab0c71dcd8a48bf85c8fc4072
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 163.7 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 |
b680bcde02d1ba0b9791d092804733a517fb3bfe9b32e002a0622ce2286e6304
|
|
BLAKE2b-256 checksum How to use checksums |
10c93dce1e4dc071e8ed536ab30694798fd5d4c7e3a1c875dff60517195bb5bd
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 138.6 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
715948740c5a2398564b20e0303ce855024ebce1a6c8de79e8468f71c4fe9127
|
|
BLAKE2b-256 checksum How to use checksums |
478abe6748e2b1ab5ff8f4b14e0f815627162b1447cebaa7fc6397e612894c28
|
| 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 Jun 21, 2026.
Transparency logRelease files / tree_sitter_dart-0.1.0-cp38-abi3-macosx_10_13_x86_64.whl
| Download URL | tree_sitter_dart-0.1.0-cp38-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 130.2 kB |
| Tags | CPython 3.8 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
8630403e224ecc585eed92ef608af6f3d65728511a0e4340686716273b94b56d
|
|
BLAKE2b-256 checksum How to use checksums |
3d0d77f161a7a14b837e051c11ce6432830978491c0608bf1686a39706253fe0
|
| 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 Jun 21, 2026.
Transparency log