11
src/syn/util.rs
Normal file
11
src/syn/util.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
pub fn got_char_or_eof(got: Option<char>) -> String {
|
||||
if let Some(got) = got {
|
||||
expected_got_char(got)
|
||||
} else {
|
||||
"EOF".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expected_got_char(c: char) -> String {
|
||||
format!("character {}", c.escape_debug())
|
||||
}
|
||||
Reference in New Issue
Block a user