use pesticide::pesticide; // #[pesticide] // mod ast { // pub enum Value { // #[silent(r#" "null" "#)] // None, // Bool(bool), // Integer(i64), // Float(f64), // String(String), // } // pub enum Expr { // Value(Value), // } // } #[derive(Debug)] pub struct MyStruct { pub a: i32, } #[pesticide] mod ast { #[derive(Debug)] pub struct Expr { #[silent(r#" "null" "#)] pub val1: (), #[atomic(r#" "+" | "-" | "*" | "/" "#)] pub op: String, #[repeat(char = '+', split = ',', last_split = false)] pub val2: Vec, #[ignore(init_value=crate::MyStruct{a:42})] my_struct: crate::MyStruct, } } fn main() { let expr = ast::Expr::try_parse(r#" null+3,4,5 "#).unwrap(); println!("ast: {:?}", expr); }