use astray_macro::{set_token,SN}; use astray_core::*; set_token!(Token); #[derive(SN, PartialEq, Debug)] pub struct KInt { #[pattern(Token::KInt)] kint: Token } // impl Parsable for KInt { // fn parse(iter:&mut TokenIter) -> Result { // let kint = iter.parse_if_match(|tok|matches!(tok,Token::KInt))?; // Ok(Identifier{kint}) // } // } fn main() { let tokens = vec![ t!( int ) ]; let mut iter = TokenIter::new(tokens); let result = KInt::parse(&mut iter); assert!(result.unwrap().kint == Token::KInt); }