Skip to main content

display_kind

Function display_kind 

Source
pub fn display_kind(kind: &TokenKind) -> &'static str
Expand description

the human spelling of a token kind, for error messages: ) not RParen, end of input for TokenKind::Eof, a category name for the payload-carrying kinds (an identifier, an integer literal).

this is the one place the mapping lives, so a new token kind is one line here. the strings are quoted where the token is a literal symbol so a message reads “expected , or )”, not “expected , or )”.