12 releases
0.7.0 | Feb 11, 2024 |
---|---|
0.6.0 | Nov 28, 2022 |
0.5.1 |
|
0.2.0 | Jul 17, 2022 |
#40 in #peg
107 downloads per month
Used in 3 crates
(via bpf-script)
275KB
6.5K
SLoC
Peginator macro
Proc-macro support for peginator. Please find documentation and other goodies on the main project.
Usage:
use peginator_macro::peginate;
use peginator::PegParser;
peginate!("
@export
PizzaRule =
'Pizza' 'with'
toppings:Topping
{',' toppings:Topping}
['and' toppings:Topping]
;
@string
Topping = 'sausage' | 'pineapple' | 'bacon' | 'cheese';
");
fn main() {
let result = PizzaRule::parse("Pizza with sausage, bacon and cheese").unwrap();
println!("{:?}", result.toppings);
}
Dependencies
~0.5–11MB
~63K SLoC