pub fn got_char_or_eof(got: Option) -> 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()) }