Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: runtime/vm/scanner.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/scanner.h ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index 50073cd9ba0d8e03359297cbceda84a365701d77..a0404760773732ec946f5f63462ccacfc2592125 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -909,8 +909,8 @@ void Scanner::ScanAll(GrowableTokenStream* token_stream) {
}
-void Scanner::ScanTo(intptr_t token_index) {
- int index = 0;
+void Scanner::ScanTo(TokenPosition token_index) {
+ TokenPosition index = TokenPosition::kMinSource;
Reset();
do {
Scan();
@@ -919,16 +919,18 @@ void Scanner::ScanTo(intptr_t token_index) {
for (intptr_t diff = current_token_.position.line - prev_token_line_;
diff > 0;
diff--) {
- index++; // Advance the index to account for tokens added in ScanAll.
+ // Advance the index to account for tokens added in ScanAll.
+ index.Next();
inserted_new_lines = true;
}
if (inserted_new_lines &&
((current_token_.kind == Token::kINTERPOL_VAR) ||
(current_token_.kind == Token::kINTERPOL_START))) {
- index++; // Advance the index to account for tokens added in ScanAll.
+ // Advance the index to account for tokens added in ScanAll.
+ index.Next();
}
- index++;
+ index.Next();
prev_token_line_ = current_token_.position.line;
} while ((token_index >= index) && (current_token_.kind != Token::kEOS));
}
« no previous file with comments | « runtime/vm/scanner.h ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698