forked from AbleOS/ableos_userland
update
This commit is contained in:
parent
6a94aa3e84
commit
a2bca6f901
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue