generated from ElnuDev/rust-project
Improve debugging
This commit is contained in:
parent
24e33aa550
commit
8faf2eb636
2 changed files with 8 additions and 4 deletions
|
@ -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
|
11
src/lib.rs
11
src/lib.rs
|
@ -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…
Add table
Reference in a new issue