|
|
@ -19,11 +19,14 @@ pub fn parse(file_path: &str) {
|
|
|
|
for token in line.into_inner() {
|
|
|
|
for token in line.into_inner() {
|
|
|
|
match token.as_rule() {
|
|
|
|
match token.as_rule() {
|
|
|
|
Rule::token => {
|
|
|
|
Rule::token => {
|
|
|
|
println!("{}", token.as_str());
|
|
|
|
let token = token.into_inner().next().unwrap();
|
|
|
|
|
|
|
|
match token.as_rule() {
|
|
|
|
|
|
|
|
Rule::string => println!("string: {}", token.as_str()),
|
|
|
|
|
|
|
|
Rule::keyword => println!("keyword: {}", token.as_str()),
|
|
|
|
|
|
|
|
_ => unreachable!(),
|
|
|
|
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
_ => {
|
|
|
|
_ => unreachable!(),
|
|
|
|
println!("{}", token.as_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!()
|
|
|
|
println!()
|
|
|
|