func kind_name(kind: TokenKind) -> StringReturns the frozen PascalCase name used by validation dumps.
This differs from kind_spelling, which returns source punctuation, keywords, or placeholders. Renaming an output changes differential-parser fixtures.
View Source
pub func kind_name(kind: TokenKind) -> String {
match kind {
.identifier -> "Identifier",
.int_number -> "Int",
.float_number -> "Float",
.string_literal -> "StringLiteral",
.character_literal -> "CharacterLiteral",
.keyword_let -> "Let",
.keyword_true -> "True",
.keyword_false -> "False",
.equals -> "Equals",
.comma -> "Comma",
.dot -> "Dot",
.dot_dot -> "DotDot",
.dot_dot_dot -> "DotDotDot",
.dot_dot_less -> "DotDotLess",
.left_paren -> "LeftParen",
.right_paren -> "RightParen",
.left_bracket -> "LeftBracket",
.right_bracket -> "RightBracket",
.left_brace -> "LeftBrace",
.right_brace -> "RightBrace",
.newline -> "Newline",
.underscore -> "Underscore",
.keyword_any -> "Any",
.keyword_as -> "As",
.keyword_func -> "Func",
.keyword_if -> "If",
.keyword_else -> "Else",
.keyword_loop -> "Loop",
.keyword_enum -> "Enum",
.keyword_case -> "Case",
.keyword_match -> "Match",
.keyword_return -> "Return",
.keyword_struct -> "Struct",
.keyword_extend -> "Extend",
.keyword_break -> "Break",
.keyword_init -> "Init",
.keyword_protocol -> "Protocol",
.keyword_import -> "Import",
.keyword_use -> "Use",
.keyword_pub -> "Pub",
.keyword_public -> "Public",
.keyword_linear -> "Linear",
.keyword_macro -> "Macro",
.keyword_static -> "Static",
.keyword_associated -> "Associated",
.keyword_typealias -> "Typealias",
.keyword_effect -> "Effect",
.keyword_handling -> "Handling",
.keyword_in -> "In",
.keyword_continue -> "Continue",
.keyword_unreachable -> "Unreachable",
.keyword_mut -> "Mut",
.keyword_consuming -> "Consuming",
.keyword_for -> "For",
.plus -> "Plus",
.plus_equals -> "PlusEquals",
.minus -> "Minus",
.minus_equals -> "MinusEquals",
.arrow -> "Arrow",
.star -> "Star",
.star_equals -> "StarEquals",
.slash -> "Slash",
.slash_equals -> "SlashEquals",
.percent -> "Percent",
.bang -> "Bang",
.bang_equals -> "BangEquals",
.equals_equals -> "EqualsEquals",
.less -> "Less",
.less_equals -> "LessEquals",
.less_less -> "LessLess",
.greater -> "Greater",
.greater_equals -> "GreaterEquals",
.greater_greater -> "GreaterGreater",
.amp -> "Amp",
.amp_amp -> "AmpAmp",
.amp_equals -> "AmpEquals",
.pipe -> "Pipe",
.pipe_pipe -> "PipePipe",
.colon -> "Colon",
.double_colon -> "DoubleColon",
.question_mark -> "QuestionMark",
.semicolon -> "Semicolon",
.at_sign -> "At",
.tilde -> "Tilde",
.tilde_equals -> "TildeEquals",
.caret -> "Caret",
.caret_equals -> "CaretEquals",
.attribute -> "Attribute",
.dollar -> "Dollar",
.bound_var -> "BoundVar",
.hash -> "Hash",
.ir_register -> "IRRegister",
.effect_name -> "EffectName",
.single_quote -> "SingleQuote",
.eof -> "EOF",
.line_comment -> "LineComment"
}
}