mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Support lexing and parsing positional params (#7651)
This implements lexing and parsing positional parameters such as `$0`.
This commit is contained in:
@@ -93,7 +93,8 @@ auto TokenizedBuffer::GetTokenText(TokenIndex token) const -> llvm::StringRef {
|
||||
|
||||
// Refer back to the source text to avoid needing to reconstruct the
|
||||
// spelling from the size.
|
||||
if (token_info.kind().is_sized_type_literal()) {
|
||||
if (token_info.kind().is_sized_type_literal() ||
|
||||
token_info.kind().is_dollar_int_literal()) {
|
||||
llvm::StringRef suffix = source_->text()
|
||||
.substr(token_info.byte_offset() + 1)
|
||||
.take_while(IsDecimalDigit);
|
||||
|
||||
Reference in New Issue
Block a user