Improve debugging

main
Elnu 2 years ago
parent 24e33aa550
commit 8faf2eb636

@ -4,6 +4,7 @@ what the heck
"this is a string with a # comment"
"this is a string over
multiple lines"
"this is \"escaped\""
this is cool # comment
huh

@ -19,11 +19,14 @@ pub fn parse(file_path: &str) {
for token in line.into_inner() {
match token.as_rule() {
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!(),
};
},
_ => {
println!("{}", token.as_str());
}
_ => unreachable!(),
}
}
println!()

Loading…
Cancel
Save