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-Perkins
2025-08-01 18:24:03 +00:00
committed by GitHub
co-authored by Richard Smith
parent c707a6deaa
commit cae8aa3adf
14 changed files with 314 additions and 79 deletions
+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_;