Add support for char keyword per #5903. (#6078)

Make inst namer and stringify print `Core.Char` and `Core.String` as
`char` and `str` respectively. Plus a few cleanups.
This commit is contained in:
Richard Smith
2025-09-16 20:45:01 +00:00
committed by GitHub
parent 59c4cbcaf1
commit bac828d244
21 changed files with 351 additions and 106 deletions
+6 -1
View File
@@ -114,6 +114,11 @@ auto HandleExprInPostfix(Context& context) -> void {
context.PushState(state);
break;
}
case Lex::TokenKind::Char: {
context.AddLeafNode(NodeKind::CharTypeLiteral, context.Consume());
context.PushState(state);
break;
}
case Lex::TokenKind::IntTypeLiteral: {
context.AddLeafNode(NodeKind::IntTypeLiteral, context.Consume());
context.PushState(state);
@@ -129,7 +134,7 @@ auto HandleExprInPostfix(Context& context) -> void {
context.PushState(state);
break;
}
case Lex::TokenKind::StringTypeLiteral: {
case Lex::TokenKind::Str: {
context.AddLeafNode(NodeKind::StringTypeLiteral, context.Consume());
context.PushState(state);
break;