1 unstable release
Uses new Rust 2024
| 0.1.0 | Dec 28, 2025 |
|---|
#2354 in Parser implementations
52KB
1.5K
SLoC
Protocol Buffers (proto2/proto3) parser that produces a typed AST.
Examples
use protobuf_ast_parser::parse;
let source = r#"syntax = "proto3"; message User { string name = 1; }"#;
let ast = parse(source).expect("valid proto");
assert!(!ast.is_empty());
protobuf-parser
A Rust parser for Protocol Buffers (proto2 and proto3) built with LALRPOP + Logos.
It focuses on turning .proto files into a lightweight AST while preserving comments,
which is handy for tooling, linting, and analysis workflows.
Usage
use protobuf_parser::parse;
let source = r#"
syntax = "proto3";
message User { string name = 1; }
"#;
let ast = parse(source)?;
Dependencies
~3–5.5MB
~104K SLoC