// How a token kind is named in a diagnostic.
//
// Generated ONCE from the %token declarations in ../parser/parser.mbty, and
// maintained by hand since: the generator it came from
// (`tools/gen_expect_string.py`) was never committed, so this is the source of
// truth. Add an arm when a token is added -- a terminal missing from here
// renders in a diagnostic as its internal name.
//
// Punctuation is quoted as it is written; keywords are quoted in lower case;
// the value-carrying tokens get the readable phrases the reference uses in
// src/lib-wax/parser_messages.config ("an identifier", not "IDENT"), so the
// wording lines up where it can.
///|
pub fn TokenKind::to_expect_string(self : Self) -> String {
match self {
TK_IDENT => "an identifier"
TK_INT => "an integer"
TK_FLOAT => "a float"
TK_STRING => "a string"
TK_CHAR => "a character"
TK_EOF => "end of file"
TK_INF => "'inf'"
TK_NAN => "'nan'"
TK_SEMI => "';'"
TK_SHARP => "'#'"
TK_QUESTIONMARK => "'?'"
TK_LPAREN => "'('"
TK_RPAREN => "')'"
TK_LBRACE => "'{'"
TK_RBRACE => "'}'"
TK_LBRACKET => "'['"
TK_RBRACKET => "']'"
TK_COMMA => "','"
TK_COLON => "':'"
TK_COLONCOLON => "'::'"
TK_ARROW => "'->'"
TK_FATARROW => "'=>'"
TK_EQUAL => "'='"
TK_COLONEQUAL => "':='"
TK_AT => "'@'"
TK_QUOTE => "'''"
TK_DOT => "'.'"
TK_DOTDOT => "'..'"
TK_BANG => "'!'"
TK_PLUS => "'+'"
TK_PLUSPLUS => "'++'"
TK_PLUSEQUAL => "'+='"
TK_MINUS => "'-'"
TK_MINUSEQUAL => "'-='"
TK_STAR => "'*'"
TK_STAREQUAL => "'*='"
TK_SLASH => "'/'"
TK_SLASHEQUAL => "'/='"
TK_SLASHS => "'/s'"
TK_SLASHSEQUAL => "'/s='"
TK_SLASHU => "'/u'"
TK_SLASHUEQUAL => "'/u='"
TK_PERCENTS => "'%s'"
TK_PERCENTSEQUAL => "'%s='"
TK_PERCENTU => "'%u'"
TK_PERCENTUEQUAL => "'%u='"
TK_AMPERSAND => "'&'"
TK_AMPERSANDEQUAL => "'&='"
TK_PIPE => "'|'"
TK_PIPEEQUAL => "'|='"
TK_CARET => "'^'"
TK_CARETEQUAL => "'^='"
TK_SHL => "'<<'"
TK_SHLEQUAL => "'<<='"
TK_SHRS => "'>>s'"
TK_SHRSEQUAL => "'>>s='"
TK_SHRU => "'>>u'"
TK_SHRUEQUAL => "'>>u='"
TK_EQUALEQUAL => "'=='"
TK_BANGEQUAL => "'!='"
TK_GT => "'>'"
TK_GTS => "'>s'"
TK_GTU => "'>u'"
TK_LT => "'<'"
TK_LTS => "' "' "'>='"
TK_GES => "'>=s'"
TK_GEU => "'>=u'"
TK_LE => "'<='"
TK_LES => "'<=s'"
TK_LEU => "'<=u'"
TK_UNDERSCORE => "'_'"
TK_FN => "'fn'"
TK_TAG => "'tag'"
TK_MUT => "'mut'"
TK_TYPE => "'type'"
TK_REC => "'rec'"
TK_OPEN => "'open'"
TK_NOP => "'nop'"
TK_UNREACHABLE => "'unreachable'"
TK_NULL => "'null'"
TK_DO => "'do'"
TK_WHILE => "'while'"
TK_LOOP => "'loop'"
TK_IF => "'if'"
TK_ELSE => "'else'"
TK_CONST => "'const'"
TK_LET => "'let'"
TK_AS => "'as'"
TK_IS => "'is'"
TK_BECOME => "'become'"
TK_BR => "'br'"
TK_BR_IF => "'br_if'"
TK_BR_TABLE => "'br_table'"
TK_RETURN => "'return'"
TK_THROW => "'throw'"
TK_THROW_REF => "'throw_ref'"
TK_BR_ON_CAST => "'br_on_cast'"
TK_BR_ON_CAST_FAIL => "'br_on_cast_fail'"
TK_BR_ON_NULL => "'br_on_null'"
TK_BR_ON_NON_NULL => "'br_on_non_null'"
TK_TRY => "'try'"
TK_TRY_LEGACY => "'try_legacy'"
TK_CATCH => "'catch'"
TK_CONT => "'cont'"
TK_SUSPEND => "'suspend'"
TK_ON => "'on'"
TK_DISPATCH => "'dispatch'"
TK_MATCH => "'match'"
TK_MEMORY => "'memory'"
TK_DATA => "'data'"
TK_TABLE => "'table'"
TK_ELEM => "'elem'"
TK_PAGESIZE => "'pagesize'"
TK_SHARED => "'shared'"
TK_DESCRIPTOR => "'descriptor'"
TK_DESCRIBES => "'describes'"
TK_IMPORT => "'import'"
}
}
///|
pub fn Token::to_expect_string(self : Self) -> String {
self.kind().to_expect_string()
}