JSPM

  • Created
  • Published
  • Downloads 239992
  • Score
    100M100P100Q190338F
  • License MIT

Rust grammar for tree-sitter

Package Exports

  • tree-sitter-rust
  • tree-sitter-rust/bindings/node/index.js
  • tree-sitter-rust/grammar
  • tree-sitter-rust/grammar.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tree-sitter-rust) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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