Support lexing characters (#5893)

Adapts `StringLiteral` to lex characters. Adds a `CharLiteral` token,
which contains a `CharLiteralValue` which is a straight unicode code
point (suggested by zygoloid).

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-PerkinsandRichard Smith authored and GitHub committed 2025-08-01 18:24:03 +00:00
1 parent c707a6deaa
commit cae8aa3adf
14 files changed
+314 -79

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ class StringLiteralTest : public ::testing::Test {
auto Parse(llvm::StringRef text) -> llvm::StringRef {
StringLiteral token = Lex(text);
Testing::SingleTokenDiagnosticEmitter emitter(&error_tracker_, text);
return token.ComputeValue(allocator_, emitter);
return token.ComputeStringValue(allocator_, emitter);
}
llvm::BumpPtrAllocator allocator_;