# tree-sitter-rust
[![CI][ci]](https://github.com/tree-sitter/tree-sitter-rust/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-rust)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-rust)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-rust)
Rust grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
## Features
- **Speed** — When initially parsing a file, `tree-sitter-rust` takes around two to three times
as long as rustc's hand-written parser.
```sh
$ wc -l examples/ast.rs
2157 examples/ast.rs
$ rustc -Z unpretty=ast-tree -Z time-passes examples/ast.rs | head -n0
time: 0.002; rss: 55MB -> 60MB ( +5MB) parse_crate
$ tree-sitter parse examples/ast.rs --quiet --time
examples/ast.rs 6.48 ms 9908 bytes/ms
```
But if you _edit_ the file after parsing it, tree-sitter can generally _update_
the previous existing syntax tree to reflect your edit in less than a millisecond,
thanks to its incremental parsing system.
## References
- [The Rust Reference](https://doc.rust-lang.org/reference/) — While Rust does
not have a specification, the reference tries to describe its working in detail.
It tends to be out of date.
- [Keywords](https://doc.rust-lang.org/stable/book/appendix-01-keywords.html) and
[Operators and Symbols](https://doc.rust-lang.org/stable/book/appendix-02-operators.html).
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-rust/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-rust?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-rust?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-rust?logo=pypi&logoColor=ffd242
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-rust",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, rust",
"author": null,
"author_email": "Max Brunsfeld <maxbrunsfeld@gmail.com>, Amaan Qureshi <amaanq12@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fd/bf/ff80aef689875cce54f1b80729c703af162b03ddd20b9829c53453dd43db/tree_sitter_rust-0.23.2.tar.gz",
"platform": null,
"description": "# tree-sitter-rust\n\n[![CI][ci]](https://github.com/tree-sitter/tree-sitter-rust/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-rust)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-rust)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-rust)\n\nRust grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\n## Features\n\n- **Speed** \u2014 When initially parsing a file, `tree-sitter-rust` takes around two to three times\n as long as rustc's hand-written parser.\n\n ```sh\n $ wc -l examples/ast.rs\n 2157 examples/ast.rs\n\n $ rustc -Z unpretty=ast-tree -Z time-passes examples/ast.rs | head -n0\n time: 0.002; rss: 55MB -> 60MB ( +5MB) parse_crate\n\n $ tree-sitter parse examples/ast.rs --quiet --time\n examples/ast.rs 6.48 ms 9908 bytes/ms\n ```\n\n But if you _edit_ the file after parsing it, tree-sitter can generally _update_\n the previous existing syntax tree to reflect your edit in less than a millisecond,\n thanks to its incremental parsing system.\n\n## References\n\n- [The Rust Reference](https://doc.rust-lang.org/reference/) \u2014 While Rust does\n not have a specification, the reference tries to describe its working in detail.\n It tends to be out of date.\n- [Keywords](https://doc.rust-lang.org/stable/book/appendix-01-keywords.html) and\n [Operators and Symbols](https://doc.rust-lang.org/stable/book/appendix-02-operators.html).\n\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-rust/ci.yml?logo=github&label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[npm]: https://img.shields.io/npm/v/tree-sitter-rust?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-rust?logo=rust\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-rust?logo=pypi&logoColor=ffd242\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Rust grammar for tree-sitter",
"version": "0.23.2",
"project_urls": {
"Homepage": "https://github.com/tree-sitter/tree-sitter-rust"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" rust"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5505f5c50201de4c959a8fdc1edbc29ea541a96cbe4fb794e36040bc8207ea39",
"md5": "1a1e289df42bea269b62d9098360f1f1",
"sha256": "b6b26a4c07ddc243f3701450ff34093b8e3b08f14d269db2d049c625d151677c"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "1a1e289df42bea269b62d9098360f1f1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 123482,
"upload_time": "2024-11-24T18:52:18",
"upload_time_iso_8601": "2024-11-24T18:52:18.391244Z",
"url": "https://files.pythonhosted.org/packages/55/05/f5c50201de4c959a8fdc1edbc29ea541a96cbe4fb794e36040bc8207ea39/tree_sitter_rust-0.23.2-cp39-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "be5a8f5b0e1e7dbe4994b692af989d10aaa295cf374ae0b8fe019341c9a2d70a",
"md5": "e16254993bebdc29ceb3195e72f1d545",
"sha256": "c6224f608df559d75425e5ef428f635b9fb87d7aa8716444915ee67ec6955085"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "e16254993bebdc29ceb3195e72f1d545",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 130906,
"upload_time": "2024-11-24T18:52:20",
"upload_time_iso_8601": "2024-11-24T18:52:20.545031Z",
"url": "https://files.pythonhosted.org/packages/be/5a/8f5b0e1e7dbe4994b692af989d10aaa295cf374ae0b8fe019341c9a2d70a/tree_sitter_rust-0.23.2-cp39-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0051ebe563835da804af4dbab5c94b5887601be60788e3caca55b140ef988bcc",
"md5": "31f0582753e4aca2e64be71ab7c85d6d",
"sha256": "deced590a85ce848cda56f33728bad93b95827c1e3c736b707b24fb4280b3788"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "31f0582753e4aca2e64be71ab7c85d6d",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 159109,
"upload_time": "2024-11-24T18:52:21",
"upload_time_iso_8601": "2024-11-24T18:52:21.474323Z",
"url": "https://files.pythonhosted.org/packages/00/51/ebe563835da804af4dbab5c94b5887601be60788e3caca55b140ef988bcc/tree_sitter_rust-0.23.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "22859b137393d39279d24acbb5ff69e6103a3793b988f11c2ab3c06e3b23a09b",
"md5": "735ab8dee8daf9a727421573ffd95192",
"sha256": "540cf826932fe7cfd800361e368617e138c3d7914fad3b90786b7505af216be6"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "735ab8dee8daf9a727421573ffd95192",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 157641,
"upload_time": "2024-11-24T18:52:22",
"upload_time_iso_8601": "2024-11-24T18:52:22.597168Z",
"url": "https://files.pythonhosted.org/packages/22/85/9b137393d39279d24acbb5ff69e6103a3793b988f11c2ab3c06e3b23a09b/tree_sitter_rust-0.23.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bfa0ee88affed29ec9e9b3d84663f4b700d55f68ab6e7ba69b1afc37982d5390",
"md5": "09693cb9a89a0a5dc265cf95c75ea067",
"sha256": "880be40b220e87105b60db48c57cdd8019b5039b324afb1d643fa9c2fc187873"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "09693cb9a89a0a5dc265cf95c75ea067",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 154858,
"upload_time": "2024-11-24T18:52:23",
"upload_time_iso_8601": "2024-11-24T18:52:23.580129Z",
"url": "https://files.pythonhosted.org/packages/bf/a0/ee88affed29ec9e9b3d84663f4b700d55f68ab6e7ba69b1afc37982d5390/tree_sitter_rust-0.23.2-cp39-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c2e37c9eed5a9ee61997be5b9594a838d38b708abab0332754d67ce9b650c5c9",
"md5": "7eb39635081cb2d27eff842e82bb0293",
"sha256": "d8e0bea4fd76fc8b325247f3d1bb3dc2707db7dd3818b02c251efdea1b47909c"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "7eb39635081cb2d27eff842e82bb0293",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 121448,
"upload_time": "2024-11-24T18:52:25",
"upload_time_iso_8601": "2024-11-24T18:52:25.117408Z",
"url": "https://files.pythonhosted.org/packages/c2/e3/7c9eed5a9ee61997be5b9594a838d38b708abab0332754d67ce9b650c5c9/tree_sitter_rust-0.23.2-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3e4335a8da20e7a897eb33f39483a626bf21d87bc38c4effeb663a58a42c6fc3",
"md5": "8fba0616cea9968167b5b33c9b26c422",
"sha256": "3ea49daa887ad59230758e7a96432193af4a2c7183781e1e85c35d4f8cb30b6b"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2-cp39-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "8fba0616cea9968167b5b33c9b26c422",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 119579,
"upload_time": "2024-11-24T18:52:26",
"upload_time_iso_8601": "2024-11-24T18:52:26.762567Z",
"url": "https://files.pythonhosted.org/packages/3e/43/35a8da20e7a897eb33f39483a626bf21d87bc38c4effeb663a58a42c6fc3/tree_sitter_rust-0.23.2-cp39-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fdbfff80aef689875cce54f1b80729c703af162b03ddd20b9829c53453dd43db",
"md5": "cd6645ecd5738d39b30520e3df3ce9f9",
"sha256": "9088a0e0342d3de2749088811f5561994423cb10dab5ad3251003dffaa0a1bd1"
},
"downloads": -1,
"filename": "tree_sitter_rust-0.23.2.tar.gz",
"has_sig": false,
"md5_digest": "cd6645ecd5738d39b30520e3df3ce9f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 318912,
"upload_time": "2024-11-24T18:52:27",
"upload_time_iso_8601": "2024-11-24T18:52:27.724488Z",
"url": "https://files.pythonhosted.org/packages/fd/bf/ff80aef689875cce54f1b80729c703af162b03ddd20b9829c53453dd43db/tree_sitter_rust-0.23.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-24 18:52:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tree-sitter",
"github_project": "tree-sitter-rust",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-rust"
}