Improve debugging

main
Elnu 1 year ago
parent 24e33aa550
commit 8faf2eb636

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

@ -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!()

Loading…
Cancel
Save