mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix handling of repeated tuple indexing. (#4733)
Per [the design](https://docs.carbon-lang.dev/docs/design/lexical_conventions/), `x.1.2` should lex as `(x.1).2`, not as `x.(1.2)`.
This commit is contained in:
@@ -70,7 +70,8 @@ auto TokenizedBuffer::GetTokenText(TokenIndex token) const -> llvm::StringRef {
|
||||
if (token_info.kind() == TokenKind::IntLiteral ||
|
||||
token_info.kind() == TokenKind::RealLiteral) {
|
||||
std::optional<NumericLiteral> relexed_token =
|
||||
NumericLiteral::Lex(source_->text().substr(token_info.byte_offset()));
|
||||
NumericLiteral::Lex(source_->text().substr(token_info.byte_offset()),
|
||||
token_info.kind() == TokenKind::RealLiteral);
|
||||
CARBON_CHECK(relexed_token, "Could not reform numeric literal token.");
|
||||
return relexed_token->text();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user