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

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
Index: runtime/vm/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index 50073cd9ba0d8e03359297cbceda84a365701d77..414b00ec62e820c147c60b1b626aea603e86ee9a 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(dart::TokenDescriptor token_index) {
+ dart::TokenDescriptor index = dart::TokenDescriptor::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') | runtime/vm/token_descriptor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698