use pegy::Parse; #[derive(Debug, Default, Parse)] #[grammar($item0:['a'-'z''A'-'Z''0'-'9'])] pub struct AlphaDigit(char); #[derive(Debug, Default, Parse)] #[grammar($item0:['0'-'9'])] pub struct Digit(char); #[derive(Debug, Default, Parse)] #[grammar(!Digit $item0:AlphaDigit+)] pub struct Ident(Vec); pub fn main() { let re: pegy::Result = pegy::parse_blocking::("myIdent"); assert!(re.is_ok()); }