Skip to content

shadaj/tree-sitter-c2rust

 
 

Repository files navigation

tree-sitter-c2rust

Crates.io

This is a fork of Tree Sitter, but with the runtime component automatically converted to Rust using c2rust. This enables use of Tree Sitter parsers without libc, useful for targets like wasm32-unknown-unknown.

Because the conversion is automatic, the resulting code is not idiomatic Rust. But we preserve 1:1 correspondence with the original C code, so that future changes to Tree Sitter can be easily merged into this fork. Furthermore, the Rust bindings are still supported, so this can be used as a drop-in replacement for the regular Tree Sitter crate.

Currently, the converted code only supports little endian targets (which covers all tested targets for upstream except PowerPC).

About

A fork of Tree Sitter with a pure Rust runtime for WASM support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 72.8%
  • C 19.6%
  • TypeScript 5.0%
  • JavaScript 0.8%
  • C++ 0.6%
  • HTML 0.3%
  • Other 0.9%