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

Unified Diff: runtime/vm/scanner.cc

Issue 1968143002: Small fix in Scanner (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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') | no next file » | 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 4b1e550db421ed796b2955c1606626de8c81174f..bc352050cf93bfa32afb8231c760a3413f5397fe 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -914,8 +914,9 @@ void Scanner::ScanAll(GrowableTokenStream* token_stream) {
}
-void Scanner::ScanTo(TokenPosition token_index) {
- TokenPosition index = TokenPosition::kMinSource;
+void Scanner::ScanTo(intptr_t token_index) {
+ ASSERT(token_index >= 0);
+ intptr_t index = 0;
Reset();
do {
Scan();
@@ -925,7 +926,7 @@ void Scanner::ScanTo(TokenPosition token_index) {
diff > 0;
diff--) {
// Advance the index to account for tokens added in ScanAll.
- index.Next();
+ index++;
inserted_new_lines = true;
}
@@ -933,9 +934,9 @@ void Scanner::ScanTo(TokenPosition token_index) {
((current_token_.kind == Token::kINTERPOL_VAR) ||
(current_token_.kind == Token::kINTERPOL_START))) {
// Advance the index to account for tokens added in ScanAll.
- index.Next();
+ index++;
}
- index.Next();
+ index++;
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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698