Get a short name for display purposes. Returns a brief, lowercase string identifying the token kind. Useful for debugging output and test assertions. # Example ```rust use atomic_core::diff::token::TokenKind; assert_eq!(TokenKind::Word.name(), "word"); assert_eq!(TokenKind::Operator.name(), "op"); ```
(&self)
| 158 | /// assert_eq!(TokenKind::Operator.name(), "op"); |
| 159 | /// ``` |
| 160 | pub fn name(&self) -> &'static str { |
| 161 | match self { |
| 162 | TokenKind::Word => "word", |
| 163 | TokenKind::Whitespace => "ws", |
| 164 | TokenKind::Operator => "op", |
| 165 | TokenKind::Punctuation => "punct", |
| 166 | TokenKind::String => "string", |
| 167 | TokenKind::Number => "number", |
| 168 | TokenKind::Comment => "comment", |
| 169 | TokenKind::Newline => "newline", |
| 170 | TokenKind::Other => "other", |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | impl std::fmt::Display for TokenKind { |
nothing calls this directly
no outgoing calls
no test coverage detected