Expand description
§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);
}
Macros§
- peginate
- Compile peginator grammar in-place