mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:51:05 +01:00
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:
co-authored by
Richard Smith
parent
c707a6deaa
commit
cae8aa3adf
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user