protobuf_ast_parser/
lib.rs

1//! Protocol Buffers (proto2/proto3) parser that produces a typed AST.
2//!
3//! # Examples
4//! ```rust
5//! use protobuf_ast_parser::parse;
6//!
7//! let source = r#"syntax = "proto3"; message User { string name = 1; }"#;
8//! let ast = parse(source).expect("valid proto");
9//! assert!(!ast.is_empty());
10//! ```
11
12use lalrpop_util::lalrpop_mod;
13
14lalrpop_mod!(
15    #[allow(clippy::ptr_arg)]
16    #[rustfmt::skip]
17    pub proto
18);
19
20pub mod ast;
21pub mod lexer;
22mod parser;
23
24pub use ast::Root;
25pub use parser::{parse, ParseError, ParseResult};
26
27#[cfg(test)]
28mod tests;