This commit is contained in:
gingerBill
2024-12-02 11:23:55 +00:00
parent d0f87913e2
commit e2ba8ff6e6
2 changed files with 10 additions and 6 deletions

View File

@@ -370,7 +370,11 @@ gb_internal ExactValue exact_value_from_basic_literal(TokenKind kind, String con
}
case Token_Rune: {
Rune r = GB_RUNE_INVALID;
utf8_decode(string.text, string.len, &r);
if (string.len == 1) {
r = cast(Rune)string.text[0];
} else {
utf8_decode(string.text, string.len, &r);
}
return exact_value_i64(r);
}
}