This commit is contained in:
Able 2023-05-04 02:38:55 -05:00
parent 6a94aa3e84
commit a2bca6f901

View file

@ -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());
}
}
}