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())]
|
#[regex(r"//[ a-zA-Z!-+]+", |lex| lex.slice().parse().ok())]
|
||||||
Comment(String),
|
Comment(String),
|
||||||
|
|
||||||
|
#[regex("[0-9]+", |lex| lex.slice().parse().ok())]
|
||||||
|
Number(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut lex = Token::lexer(include_str!("../../../programs/aidl/assets/vfs.idl"));
|
let mut lex = Token::lexer(include_str!("../../../programs/aidl/assets/vfs.idl"));
|
||||||
|
|
||||||
for token in lex {
|
for token in lex {
|
||||||
// let ok_token = token.ok();
|
let ok_token = token.ok();
|
||||||
// if ok_token.is_some() {
|
if ok_token.is_some() {
|
||||||
// println!("{:?}", ok_token.unwrap());
|
println!("{:?}", ok_token.unwrap());
|
||||||
// }
|
}
|
||||||
println!("{:?}", token);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue