#tree-sitter #proto #incremental #parser

yanked protols-tree-sitter-proto

proto grammar for the tree-sitter parsing library

2 unstable releases

0.2.0 Jul 20, 2024
0.1.0 Jun 22, 2024

#155 in #proto

44 downloads per month

MIT license

240KB
9K SLoC

C 8K SLoC JavaScript 400 SLoC // 0.1% comments Scheme 46 SLoC Rust 33 SLoC // 0.4% comments

tree-sitter-proto

tree-sitter grammar for protocol buffer files (proto3 only).

Status

The grammar should be complete. I'm still working on the highlighting queries. I've tested the grammar against some really large and nasty proto files and it passes. Once the highlighting is stable, I'll tag 1.0.

Modifications on fork


lib.rs:

This crate provides proto language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(&protols_tree_sitter_proto::language()).expect("Error loading proto grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~75K SLoC