From a2bca6f901eb8ba3a38ffd37c21a3fb75cb88be4 Mon Sep 17 00:00:00 2001 From: Able Date: Thu, 4 May 2023 02:38:55 -0500 Subject: [PATCH] update --- programs/aidl/src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/programs/aidl/src/main.rs b/programs/aidl/src/main.rs index c3e2ccc..2823e57 100644 --- a/programs/aidl/src/main.rs +++ b/programs/aidl/src/main.rs @@ -47,16 +47,18 @@ enum Token { #[regex(r"//[ a-zA-Z!-+]+", |lex| lex.slice().parse().ok())] Comment(String), + + #[regex("[0-9]+", |lex| lex.slice().parse().ok())] + Number(String), } fn main() { let mut lex = Token::lexer(include_str!("../../../programs/aidl/assets/vfs.idl")); for token in lex { - // let ok_token = token.ok(); - // if ok_token.is_some() { - // println!("{:?}", ok_token.unwrap()); - // } - println!("{:?}", token); + let ok_token = token.ok(); + if ok_token.is_some() { + println!("{:?}", ok_token.unwrap()); + } } }