mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-26 21:21:19 +00:00
Support lexing and parsing positional params (#7651)
This implements lexing and parsing positional parameters such as `$0`.
This commit is contained in:
1 parent
27849b385c
commit
5474347d7d
14 files changed
+282
-8
No files matched your search
@@ -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