Skip to main content

Rust grammar for tree-sitter

Project description

tree-sitter-rust

CI discord matrix crates npm pypi

Rust grammar for 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.

    $ 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

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_rust-0.23.0.tar.gz (312.8 kB view hashes)

Uploaded Source

Built Distributions

tree_sitter_rust-0.23.0-cp39-abi3-win_amd64.whl (119.9 kB view hashes)

Uploaded CPython 3.9+ Windows x86-64

tree_sitter_rust-0.23.0-cp39-abi3-musllinux_1_2_x86_64.whl (153.2 kB view hashes)

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

tree_sitter_rust-0.23.0-cp39-abi3-musllinux_1_2_aarch64.whl (156.2 kB view hashes)

Uploaded CPython 3.9+ musllinux: musl 1.2+ ARM64

tree_sitter_rust-0.23.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (157.5 kB view hashes)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

tree_sitter_rust-0.23.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (156.3 kB view hashes)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

tree_sitter_rust-0.23.0-cp39-abi3-macosx_11_0_arm64.whl (129.3 kB view hashes)

Uploaded CPython 3.9+ macOS 11.0+ ARM64

tree_sitter_rust-0.23.0-cp39-abi3-macosx_10_9_x86_64.whl (122.0 kB view hashes)

Uploaded CPython 3.9+ macOS 10.9+ x86-64

Supported by

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